Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

How can I fetch user`s info when apple authentication in React native?

$
0
0

talents. How are you? I am developing a React native app and it is needed to add apple authentication. I am using Expo(sdk v35) and used expo-apple-authentication library. So now I can see AppleAuthenticationCredentialState is AUTHORIZED. The problem is how to fetch user info after that.

So I coded for fetching user info.

let urlBody = code=${authorizationCode}&client_id=${clientId}&grant_type=authorization_code;

const res = await fetch(`https://appleid.apple.com/auth/token`, {
  method: 'POST',
  body: urlBody,
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
  },
});`

but the result was

Object { "error": "invalid_client", }

I am new to apple authentication and if anyone already implemented this feature using React native, please help me. Best regards!!!


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>