FormidableLabs / FormidableLabs/react-native-app-auth
RNAppAuth Authorize Not Resolving (IOS)
- Vorherrschende Sprache
- Java
- Sterne
- 2.3k
- Forks
- 473
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
## 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,
};
}
```
Beitragsleitfaden
Rechercherichtung
Start at the authorize(pkceConfig) call in loginSpotify and reproduce the Spotify OAuth flow on iOS with the listed React Native and react-native-app-auth versions. Check the redirect behavior alongside the reported Linking.openURL test. Done means the authorize promise resolves after browser authorization and returns the access and refresh token fields shown in the example.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- ios, react-native, typescript
- Bereich
- authentication, mobile
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100