/*
 * Class:     jnistub_AuthOAuthStub
 * Method:    onAuthenticated
 * Signature: (JLcom/firebase/client/AuthData;)V
 */
JNIEXPORT void JNICALL Java_jnistub_AuthOAuthStub_onAuthenticated
(JNIEnv *, jobject, jlong cookie, jobject authData) {
    JniAuth auth = JniAuth(authData);
    JniEventProcessor::GetInstance()->EnqueueEvent(
                                                   new AuthSuccessEvent(cookie, auth.GetAuthToken(),
                                                                        auth.GetAuthUid(), auth.GetAuthExpiration()));
}
示例#2
0
uint64_t JniFirebase::GetAuthExpiration() {
    auto env = getEnv();
    if (!GetMethod(env, s_firebaseClass, "getAuth", "()Lcom.firebase.client.AuthData;",
                   &s_firebaseGetAuth)) {
        return NULL;
    }
    
    JOBJECT authData = JOBJECT(env, env->CallObjectMethod(m_firebase, s_firebaseGetAuth));
    JniAuth auth = JniAuth(authData);
    return auth.GetAuthExpiration();
}