invertase/react-native-apple-authentication

Android app crashes a soon user tries to enter Apple ID

mayur-shelar opened this issue · 1 comments

As soon the user click on the text field to enter the Apple ID the android app crashes

This is how I start the apple login

doAppleLogin = async () => {

        const rawNonce = uuid();

        const state = uuid();

        try {
            appleAuthAndroid.configure({
                clientId: clientID,
                redirectUri: redirectURI,
                scope: appleAuthAndroid.Scope.ALL,
                responseType: appleAuthAndroid.ResponseType.ALL,
                nonce: rawNonce,
                state,
            });

            const response = await appleAuthAndroid.signIn();
            if (response) {
                const code = response.code; // Present if selected ResponseType.ALL / ResponseType.CODE
                const id_token = response.id_token; // Present if selected ResponseType.ALL / ResponseType.ID_TOKEN
                const user = response.user; // Present when user first logs in using appleId
                const state = response.state; // A copy of the state value that was passed to the initial request.
                console.log("Got auth code", code);
                console.log("Got id_token", id_token);
                console.log("Got user", user);
                console.log("Got state", state);
                onSuccess(response);
            }
        } catch (error) {
            if (error && error.message) {
                switch (error.message) {
                    case appleAuthAndroid.Error.NOT_CONFIGURED:
                        onError(error);
                        console.log("appleAuthAndroid not configured yet.");
                        break;
                    case appleAuthAndroid.Error.SIGNIN_FAILED:
                        onError(error);
                        console.log("Apple signin failed.");
                        break;
                    case appleAuthAndroid.Error.SIGNIN_CANCELLED:
                        onCancel(error);
                        console.log("User cancelled Apple signin.");
                        break;
                    default:
                        onError(error);
                        break;
                }
            }
        }
    };

screenshot-1656954759886

@mayur-shelar what version of this module are you using? You did not include that information - it's important. You might include a npx react-native info from your app's directory. Are you certain that the javascript code in the bundle and the native code of the module build+installed on the device are up to date and in sync with each other? (npx react-native-clean-project can help sometimes, then rebuild)

What does the stack trace look like from adb logcat, the image isn't really searchable, and there might be more details in there.

This happens when the user enters the text box, like, they have not actually called a handler in the module, or, they are in a handler and you are definitely in the module's native code?

It would be useful to know exactly what line of javascript calling in to the module here is triggering the crash. This is not something anyone else has reported and a crash bug like this is usually a project-integration build/deploy issue so there's a high bar here for you to demonstrate we have an issue. Not trying to be antagonistic, and there may be a serious issue but I think it's more likely a local project issue