FormidableLabs / FormidableLabs/react-native-app-auth

RNAppAuth Authorize Not Resolving (IOS)

Open
#1,089 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.3k
Forks
473
PR merge metrics
No merged PRs in 30d

Description

## Issue

While trying to authenticate with Spotify, the `authorize` method is not resolving.
The app linking seems to be working, as I can open the app via
`Linking.openURL('appbundle://oauth?ping=1');` and this works fine in xcode.

---

## Environment
```ts
// versions
"react-native": "0.81.0",
"react-native-app-auth": "^8.0.3",
```

* Spotify oAuth
* IOS
* Not using EXPO

Code
It logs `[DEBUG] Preparing authorization`
It opens the browser, I authorize, the browser closes... but it does not resolve the promise.
The redirect URI is correct. As I was able to test linking above with `Linking.openURL('appbundle://oauth?ping=1');`

```ts
export async function loginSpotify() {
console.log('[DEBUG] Preparing authorization')
const res: AuthorizeResult = await authorize(pkceConfig);
console.log('[DEBUG] Authorized:', res);
return {
accessToken: res.accessToken,
refreshToken: res.refreshToken,
accessTokenExpirationDate: res.accessTokenExpirationDate,
};
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.