fullstackreact / react-native-oauth

A react-native wrapper for social authentication login for both Android and iOS
https://fullstackreact.com
MIT License
801 stars 214 forks source link

affter twitter account login there is no call back for the authorize get trigger #107

Open kathyLA opened 7 years ago

kathyLA commented 7 years ago

Hi ,

Thanks for the nice work , but I double check many steps for the library set up for ios. Once i sign in from the twitter I am able to direct back to app. but the response call back never get trigger.

bakr-baroudi commented 7 years ago

Same issue here.

michellenguyen commented 7 years ago

First of all, thank you very much for making my life a bit easier. I am using react-native version 0.43.3 and currently experiencing the same issue for both Twitter and Facebook. I have tested Google but I imagine it would be the same thing. Steps to reproduce: 1) click on Twitter sign in 2) gets redirected to twitter to sign in 3) sign in 4) gets asked by Twitter to "Open this page in ?" 5) Click on "Open" re-opens the app but DOES NOT trigger the response callback as expected. 20170421_oauth_twitter_error

Thanks in advance for any help.

batuypn commented 7 years ago

Same here, both facebook and twitter callbacks does not trigger. RN 0.43.3 IOS 10.3

vanydeasy commented 7 years ago

Same here, twitter callback on iOS does not trigger. It works perfectly on Android. I don't have any problem with facebook. It works just fine.

shuffledex commented 7 years ago

Please, can anybody help us? same problem here!

batuypn commented 7 years ago

I solved my problem, I debugged IOS code and saw that there were two duplicated methods and login callback was returning to wrong method in my AppDelegate.m. Here is my working method in AppDelegate.m:

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
            options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
  if ([url.absoluteString containsString:@"twitter"]){
    return [OAuthManager handleOpenUrl:application
                               openURL:url
                     sourceApplication:@"twitter"
                            annotation:nil];
  } else{
    // other callbacks ...
    return NO;
  }
}
dowdmatthew88 commented 7 years ago

Stop unsubscribe On Wed, May 10, 2017 at 3:21 AM Batuhan Yapanoglu notifications@github.com wrote:

I solved my problem, I debugged IOS code and saw that there were two duplicated methods and login callback was returning to wrong method in my AppDelegate.m. Here is my working method in AppDelegate.m:

  • (BOOL)application:(UIApplication )application openURL:(NSURL )url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options { if ([url.absoluteString containsString:@"twitter"]){ return [OAuthManager handleOpenUrl:application openURL:url sourceApplication:@"twitter" annotation:nil]; } else{ // other callbacks ... return NO; } }

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fullstackreact/react-native-oauth/issues/107#issuecomment-300410695, or mute the thread https://github.com/notifications/unsubscribe-auth/AZmjSDDLETkXTwLFeLdO5YUHEcIuL7W1ks5r4XN0gaJpZM4M_Zu_ .

mradzwilla commented 7 years ago

I'm having this issue as well. I tried the solution @batuypn suggested but it's still not working

beeant commented 7 years ago

same issue

novakben commented 7 years ago

Same here. @batuypn 's solution didn't help me as well.

beeant commented 7 years ago

I switched to https://github.com/tipsi/tipsi-twitter for twitter auth

BrendanBerkley commented 7 years ago

I'm having this problem as well. Facebook auth works fine so I have to think that I generally set everything up okay. I am able to link to the Twitter website, authorize, and redirect back to the app, but it fails without any feedback once I get back. Tried some of the solutions offered but nothing so far. Help is appreciated.

iOS log if helpful:

TestAppMobile[8364] <Notice>: calling signInTwitter
TestAppMobile[8364] <Warning>: Calling authorizeWithUrl: twitter with callbackURL: MyTestApp://oauth-response/twitter
     {
        "access_token_url" = "https://api.twitter.com/oauth/access_token";
        "api_url" = "https://api.twitter.com";
        "app_name" = MyTestApp;
        "auth_version" = "1.0";
        "authorize_url" = "https://api.twitter.com/oauth/authorize";
        "callback_url" = "MyTestApp://oauth-response/twitter";
        "consumer_key" = <redacted>;
        "consumer_secret" = <redacted>;
        "request_token_url" = "https://api.twitter.com/oauth/request_token";
    }
TestAppMobile[8364] <Notice>: 'app state changed', 'inactive'
# Not sure what is noise here, probably most of it
assertiond[995] <Error>: assertion failed: 16E195 14E8301: assertiond + 34783 [E94C8872-C891-3467-AE1B-FE2DEB8428F5]: 0x1
Unknown[995] <Error>: 
assertiond[995] <Error>: assertion failed: 16E195 14E8301: assertiond + 117488 [E94C8872-C891-3467-AE1B-FE2DEB8428F5]: 0x1
Unknown[995] <Error>: 
diagnosticd[1003] <Notice>: unsupported XPC object: OS_xpc_dictionary
assertiond[995] <Warning>: client <BSProcessHandle: 0x7feaebe047f0; TestAppMobile:8364; valid: YES> HWM increased to 2 because of <BKProcessAssertion: 0x7feaebc1e8e0; "com.apple.asset_manager.cache_resource_cleanup" (finishTask:180s); id:…85D515A8200B>
TestAppMobile[8364] <Notice>: 'app state changed', 'background'
com.apple.CoreSimulator.SimDevice.58C25278-A35D-4DB7-B914-4DBD26D0BB2E.launchd_sim[972] (com.apple.imfoundation.IMRemoteURLConnectionAgent) <Warning>: Unknown key for integer: _DirtyJetsamMemoryLimit
com.apple.WebKit.WebContent[8680] <Error>: objc[8680]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x11cd6dcc0) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x11cb846f0). One of the two will be used. Which one is undefined.
videosubscriptionsd[8681] <Warning>: Entering main() for videosubscriptionsd.
videosubscriptionsd[8681] <Warning>: Unable to find framework using path: /System/Library/Frameworks/VideoSubscriberAccount.framework
com.apple.CoreSimulator.SimDevice.58C25278-A35D-4DB7-B914-4DBD26D0BB2E.launchd_sim[972] (com.apple.videosubscriptionsd[8681]) <Warning>: Service exited with abnormal code: 1
com.apple.CoreSimulator.SimDevice.58C25278-A35D-4DB7-B914-4DBD26D0BB2E.launchd_sim[972] (com.apple.videosubscriptionsd) <Notice>: Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
# These popped up after switching back into the app
assertiond[995] <Error>: assertion failed: 16E195 14E8301: assertiond + 117488 [E94C8872-C891-3467-AE1B-FE2DEB8428F5]: 0x1
Unknown[995] <Error>: 
assertiond[995] <Error>: assertion failed: 16E195 14E8301: assertiond + 34783 [E94C8872-C891-3467-AE1B-FE2DEB8428F5]: 0x1
Unknown[995] <Error>: 
TestAppMobile[8364] <Notice>: 'app state changed', 'active'
jorge627 commented 7 years ago

Please help, same problem here !

arminsal1 commented 7 years ago

Did anyone figure this out? I'm having the same issue.

LeonidasEsteban commented 7 years ago

This is happen to me after change the Signing team :(

mackenziemance commented 7 years ago

Also having this issue

SailingSteve commented 7 years ago

@BrendanBerkley This is probably months too late, but by debugging into objectiveC I found that the scheme has to be all lowercase. So in your

TestAppMobile[8364] <Warning>: Calling authorizeWithUrl: twitter with callbackURL: MyTestApp://oauth-response/twitter
     {
        "access_token_url" = "https://api.twitter.com/oauth/access_token";
        "api_url" = "https://api.twitter.com";
        "app_name" = MyTestApp;
        "auth_version" = "1.0";
        "authorize_url" = "https://api.twitter.com/oauth/authorize";
        "callback_url" = "MyTestApp://oauth-response/twitter";
        "consumer_key" = <redacted>;
        "consumer_secret" = <redacted>;
        "request_token_url" = "https://api.twitter.com/oauth/request_token";
    }

The callback_url can not be "MyTestApp://oauth-response/twitter" it would have to be "mytestapp://oauth-response/twitter".

If you don't have the "URL scheme" in all lowercase it will fail silently.

bisht2ankit commented 7 years ago

@beeant I am not getting any response after connecting my app to twitter account.