React-native-apple-authentication: Getting "AppleAuth is not supported on the device" error, though appleAuth.isSupported returns true

Created on 26 Apr 2020  路  28Comments  路  Source: invertase/react-native-apple-authentication

Getting this on the emulator (iPhone 11, ios 13.4.1). Seems quite strange. Tried to reinstall the package, didn't help. What might be the cause?

no-reproduction

Most helpful comment

Working like a charm, missing some points on how redux sagas are working on my side, my bad

how do you send the request with redux sagas?
using a _call_ I always gat the "not supported" message

it works. I was using _call_ in the wrong way

Hi @aknad ,

Can I ask what the problem you were encountering was?

I'm having some trouble converting the example code that uses 'async await' into saga syntax. When I run it using the example code exactly as it's written it works fine and pops up the Apple Sign-In dialogue on my device. However, when I try and convert the syntax as I've written it below, it gives me the 'not supported' message.

appleAuthRequestResponse = yield call(appleAuth.performRequest, [{ requestedOperation: AppleAuthRequestOperation.LOGIN, requestedScopes: [AppleAuthRequestScope.EMAIL, AppleAuthRequestScope.FULL_NAME], }]);

Turned out that I needed to pass the appleAuth object through as context for the call, otherwise when the first call to 'throwIfNotSupported(this.isSupported);' is made in 'AppleAuthModule.js' it returns false, because the 'this' it is checking is not the right this, and hence 'isSupported' is undefined.

appleAuthRequestResponse = yield call([appleAuth, appleAuth.performRequest], {
    requestedOperation: AppleAuthRequestOperation.LOGIN,
    requestedScopes: [AppleAuthRequestScope.EMAIL, AppleAuthRequestScope.FULL_NAME],
});

Docs for this version of 'call': https://redux-saga.js.org/docs/api/#callcontext-fn-args

All 28 comments

Happened with me on Ipad mini 5th gen
My fix was there was no entry for @Invertase in my Pod file

  • Pod File Check for invertase if it is not present add it and pod install inside ios directory.

That's odd, auto-linking should handle all of it. I'd re-try after npx react-native-clean-project first. Could be that there is something stale in the build cache for whatever machine arch or emulator is in use

Happened with me on Ipad mini 5th gen
My fix was there was no entry for @invertase in my Pod file

  • Pod File Check for invertase if it is not present add it and pod install inside ios directory.

which exactly? I thought react-native-apple-authentication does not require manual binding in pod file

That's odd, auto-linking should handle all of it. I'd re-try after npx react-native-clean-project first. Could be that there is something stale in the build cache for whatever machine arch or emulator is in use

tried one again, the issue still persists

How did it go when you tried the example app from this repo? Without a reproduction of the failure I have no idea. It works for everyone else which strongly implies a local project issue.

We have no reproduction, closing

still exist.
How do i link this lib manyally?

problem solved on react-native: 0.62.2 using cd ios && pod install && cd ..

With RN 0.60, I had to have the following in my Podfile:

pod 'RNAppleAuthentication', :path => '../../react-native-apple-authentication'

where that path is this repo cloned on my local machine (I had issues using node_modules)

then, of course, 'pod install' if you didn't have it and added it manually

Can we reopen this? Having the same issue...

Can we reopen this? Having the same issue...

try this:

1) manually add dependency in podfile:
pod 'RNAppleAuthentication', :path => '../node_modules/@invertase/react-native-apple-authentication'

2) run "pod install"

3) add this in app.entitlements file

<key>com.apple.developer.applesignin</key>
<array>
    <string>Default</string>
</array>

try again in js

Can we reopen this? Having the same issue...

try this:

  1. manually add dependency in podfile:
    pod 'RNAppleAuthentication', :path => '../node_modules/@invertase/react-native-apple-authentication'
  2. run "pod install"
  3. add this in app.entitlements file
<key>com.apple.developer.applesignin</key>
<array>
    <string>Default</string>
</array>

try again in js

Still getting the same error...

Did you try cloning this project - instead of using node_modules?

Set your Podfile reference:

pod 'RNAppleAuthentication', :path => '../../react-native-apple-authentication'

where the path is pointing to this Github repo cloned on your machine.

Also - what iOS version is on your device?

Did you try cloning this project - instead of using node_modules?

Set your Podfile reference:

pod 'RNAppleAuthentication', :path => '../../react-native-apple-authentication'

where the path is pointing to this Github repo cloned on your machine.

Also - what iOS version is on your device?

Just tried and same error
Emulator with iOS 13.4

and i have something like this to show the login icon:
{appleAuth.isSupported && (<Icon />) }
so i dont have a clear idea of what im getting this error later

did you do 'pod deintegrate' before 'pod install' after the change to the Podfile?

1) pod deintegrate
2) pod install
3) rm -rf ~/Library/Xcode/DerivedData
4) clean project in Xcode

did you do 'pod deintegrate' before 'pod install' after the change to the Podfile?

  1. pod deintegrate
  2. pod install
  3. rm -rf ~/Library/Xcode/DerivedData
  4. clean project in Xcode

tried some: npx react-native-clean-project not sure if it the same or causes the same effect going to try those

did you do 'pod deintegrate' before 'pod install' after the change to the Podfile?

  1. pod deintegrate
  2. pod install
  3. rm -rf ~/Library/Xcode/DerivedData
  4. clean project in Xcode

Still same error... maybe is something realated to the emulator? going to wait until tomorrow to test on a real device as i dont have an usbc to lightning ...

I appreciate everyone helping Gonzalo on this - for anyone else that finds this later I just want to be 100% clear - this has no reproduction in a clean / correctly integrated project. It has always resolved to a project-specific issue, and the example itself runs. So if you run into this you must inspect your project (with various ways to do so all listed above)

did you do 'pod deintegrate' before 'pod install' after the change to the Podfile?

  1. pod deintegrate
  2. pod install
  3. rm -rf ~/Library/Xcode/DerivedData
  4. clean project in Xcode

Still same error... maybe is something realated to the emulator? going to wait until tomorrow to test on a real device as i dont have an usbc to lightning ...

It should work on a Simulator. Works for me. Did you log in to an Apple account in Settings?

I appreciate everyone helping Gonzalo on this - for anyone else that finds this later I just want to be 100% clear - this has no reproduction in a clean / correctly integrated project. It has always resolved to a project-specific issue, and the example itself runs. So if you run into this you must inspect your project (with various ways to do so all listed above)

Yes i know but normally 2 pair of eyes see more than one... hahahah

did you do 'pod deintegrate' before 'pod install' after the change to the Podfile?

  1. pod deintegrate
  2. pod install
  3. rm -rf ~/Library/Xcode/DerivedData
  4. clean project in Xcode

Still same error... maybe is something realated to the emulator? going to wait until tomorrow to test on a real device as i dont have an usbc to lightning ...

It should work on a Simulator. Works for me. Did you log in to an Apple account in Settings?

Oh shit, going to test this...

No luck, logged into apple account in settings and still the same

Clone this repo. Run the example app. Prove that it works first (this is standard advice when you have problems with any react-native module but certainly this case here when it's a persistent problem). Establish that baseline of success to make sure

Working like a charm, missing some points on how redux sagas are working on my side, my bad

Working like a charm, missing some points on how redux sagas are working on my side, my bad

how do you send the request with redux sagas?
using a _call_ I always gat the "not supported" message

Working like a charm, missing some points on how redux sagas are working on my side, my bad

how do you send the request with redux sagas?
using a _call_ I always gat the "not supported" message

it works. I was using _call_ in the wrong way

Working like a charm, missing some points on how redux sagas are working on my side, my bad

how do you send the request with redux sagas?
using a _call_ I always gat the "not supported" message

it works. I was using _call_ in the wrong way

Hi @aknad ,

Can I ask what the problem you were encountering was?

I'm having some trouble converting the example code that uses 'async await' into saga syntax. When I run it using the example code exactly as it's written it works fine and pops up the Apple Sign-In dialogue on my device. However, when I try and convert the syntax as I've written it below, it gives me the 'not supported' message.

appleAuthRequestResponse = yield call(appleAuth.performRequest, [{
    requestedOperation: AppleAuthRequestOperation.LOGIN,
    requestedScopes: [AppleAuthRequestScope.EMAIL, AppleAuthRequestScope.FULL_NAME],
}]);

Working like a charm, missing some points on how redux sagas are working on my side, my bad

how do you send the request with redux sagas?
using a _call_ I always gat the "not supported" message

it works. I was using _call_ in the wrong way

Hi @aknad ,

Can I ask what the problem you were encountering was?

I'm having some trouble converting the example code that uses 'async await' into saga syntax. When I run it using the example code exactly as it's written it works fine and pops up the Apple Sign-In dialogue on my device. However, when I try and convert the syntax as I've written it below, it gives me the 'not supported' message.

appleAuthRequestResponse = yield call(appleAuth.performRequest, [{ requestedOperation: AppleAuthRequestOperation.LOGIN, requestedScopes: [AppleAuthRequestScope.EMAIL, AppleAuthRequestScope.FULL_NAME], }]);

Turned out that I needed to pass the appleAuth object through as context for the call, otherwise when the first call to 'throwIfNotSupported(this.isSupported);' is made in 'AppleAuthModule.js' it returns false, because the 'this' it is checking is not the right this, and hence 'isSupported' is undefined.

appleAuthRequestResponse = yield call([appleAuth, appleAuth.performRequest], {
    requestedOperation: AppleAuthRequestOperation.LOGIN,
    requestedScopes: [AppleAuthRequestScope.EMAIL, AppleAuthRequestScope.FULL_NAME],
});

Docs for this version of 'call': https://redux-saga.js.org/docs/api/#callcontext-fn-args

Hi @everyone

I fixed my issue manually installing
pod 'RNAppleAuthentication', :path => '../node_modules/@invertase/react-native-apple-authentication'

and run 'pod install'.

NOTE: in Xcode you need to go to your project TARGETS> Project Target > Signing & Capabilities > +Capabilities and kindly check the Sign in with apple.

make sure you clean your projects cache and do the steps.

Hope it helps.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kp654321 picture kp654321  路  9Comments

metawort picture metawort  路  6Comments

DIGITALSQUAD picture DIGITALSQUAD  路  5Comments

odarino picture odarino  路  9Comments

bcbcbcbcbcl picture bcbcbcbcbcl  路  8Comments