react-native-apple-authentication返回appleAuthAndroid的空对象

问题描述

我正在尝试在@invertase/react-native-apple-authentication": "2.1.0"上使用react-native@0.61.5在Android上实现Apple auth。 appleAuth在iOS上运行良好,但appleAuthAndroid只是返回一个空对象。

import { appleAuth,appleAuthAndroid } from '@invertase/react-native-apple-authentication';

export const loginWithAppleAndroid = () => async () => {
  // performs login request
  try {
    console.log('appleAuth',appleAuth)  //logs full appleAuth object as expected
    console.log('appleAuthAndroid',appleAuthAndroid)    //logs an empty object 

    const rawNonce = uuidv4();
    const state = uuidv4();

  // Configure the request
    appleAuthAndroid.configure({
    
    // The Service ID you registered with Apple
    clientId: ' myID',// Return URL added to your Apple dev console. We intercept this redirect,but it must still match
    // the URL you provided to Apple. It can be an empty route on your backend as it's never called.
    redirectUri: 'https://myURI.com',// The type of response requested - code,id_token,or both.
    responseType: appleAuthAndroid.ResponseType.ALL,// The amount of user information requested from Apple.
    scope: appleAuthAndroid.Scope.ALL,// Random nonce value that will be SHA256 hashed before sending to Apple.
    nonce: rawNonce,// Unique state value used to prevent CSRF attacks. A UUID will be generated if nothing is provided.
    state,});

  // Open the browser window for user sign in
  const response = await appleAuthAndroid.signIn();

  // Send the authorization code to your backend for verification
    return response
  } catch (error) {
      console.warn(appleAuth.State);
        throw error;
      
  }
};

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)