React-native-app-auth: Exception '<AppDelegate: 0x600001ce4120> does not conform to RNAppAuthAuthorizationFlowManager' was thrown while invoking authorize on target RNAppAuth with params. (. IOS )

Created on 24 Feb 2020  ·  10Comments  ·  Source: FormidableLabs/react-native-app-auth

Issue

So i am using react-native-app-auth. version 4.4.0
While calling authorize() method i get a error only for IOS, not for android
Screenshot 2020-02-21 at 12 52 05 PM

STEPS I TOOK
1) Got config * and save it to state
2) Pass as parameter for authorize( this.state.configauth )

Config Structure looks like this
{

   "issuer”:”Link”,
   "clientId”:”I”d,
   "redirectUrl”:”Link”,
   "additionalParameters":{

      "nonce":"PauKyLe3456bhMgv/OJT7WSx6Q9RiBc/D3zDt4hxsHrkIMMDst0546bsg890dfsgaVVJVOjEniDP7h4e2uOokHUHMIwgk="
   },
   "scopes":[

      "openid",
      "d4a48c9efghfg-429b-9ab5-a4e2e2126079",
      "offline_access"
   ],
   "serviceConfiguration":{

      "authorizationEndpoint":"Link",
      "tokenEndpoint":"Link",
      "revocationEndpoint":"Link
   }
}


Environment

dependencies

"react": "16.9.0",
"react-native": "0.61.4",
"react-native-app-auth": "^4.4.0",

OS -> MacOS Catalina, Simulator-> iphone11Pro

Most helpful comment

I was having similar issue, but later I realize that I did not update AppDelegate.h as per documentation. Once I update AppDelegate.h that error is gone.

All 10 comments

bump! Hi Devs. This issue could really use some love and attention. It has me completely blocked. I've already missed one deadline because of it. Help is appreciated.

To get around it, I commented out the following code in node_modules/react-native-app-auth/ios/RNAppAuth.m which throws the error.

  if (![[appDelegate class] conformsToProtocol:@protocol(RNAppAuthAuthorizationFlowManager)]) {
        [NSException raise:@"RNAppAuth Missing protocol conformance"
                  format:@"%@ does not conform to RNAppAuthAuthorizationFlowManager", appDelegate];
 }

Dependencies:

"react": "~16.9.0",
    "react-dom": "~16.9.0",
    "react-native": "~0.61.5",
    "react-native-app-auth": "^5.1.1",

Does it fix the issue, or just kick it down the road to be someone else’s problem?

I was having similar issue, but later I realize that I did not update AppDelegate.h as per documentation. Once I update AppDelegate.h that error is gone.

@saachitech what does that mean? Which AppDelegate? How did you update it? Your comment needs more detail, please.

@mjstelly You can find AppDelegate.h in ios/[whatever_your_project_name] directory. You can open this file in xcode and update it according to the docs link I commented in my last comment. Hope this helps!

@saachitech That did the trick. I'm in your debt. Thanks!

hi with me this code didn't work, my react is 0.62.2 the app goes and closes

correct instead of using the documentation import uses this the rest can follow normal

#import <react-native-app-auth / RNAppAuthAuthorizationFlowManager.h>

this comment explains the correct fix for this.

thanks @saachitech 🤗

Was this page helpful?
0 / 5 - 0 ratings