Wizcorp / phonegap-facebook-plugin

The official plugin for Facebook in Apache Cordova/PhoneGap
Other
1.91k stars 2k forks source link

Facebook app conflict with plugin Login on iOS #697

Open valodik opened 10 years ago

valodik commented 10 years ago

The Login works perfect when the facebook app is not installed on the device. Once the facebook app is installed after the authentication via app returns to my app with the error message "Error, Please try later.".

I'm using: xCode 6.0.1 Phonegap 3.5.0 Facebook plugin 0.8.0 Facebook SDK 3.15

Any idea or solution? Is this plugin not compatible with the facebook app and it's only works via web authentication?

Thanks in advance

aogilvie commented 10 years ago

@valodik can you provide a screenshot and your logcat output please.

edwardbc commented 10 years ago

I was able to replicate this on iOS without having the native app installed, by doing the following:

This is happening after calling 'facebookConnectPlugin.login(['email']'

This is the same as https://github.com/Wizcorp/phonegap-facebook-plugin/issues/479

arthursouviron commented 10 years ago

Hi, I think I found the issue, the url generated to connect via Facebook contains a "public_info" parameter which does not exist anymore. By changing the parameter to "public_profile" it works again.

The parameters specified when calling 'facebookConnectPlugin.login(['email'], success, error)' are never used

valodik commented 10 years ago

Look:

NSArray *permission = [NSArray arrayWithObjects:@"email",@"user_likes",@"public_profile", nil];

FBSession *session = [[FBSession alloc] init]; // Set the active session

[FBSession setActiveSession: [[FBSession alloc] initWithPermissions:permission] ];
// Open the session

[session openWithBehavior: FBSessionLoginBehaviorForcingWebView
//[session openWithBehavior: FBSessionLoginBehaviorForcingWebView
        completionHandler:^(FBSession *session,
                            FBSessionState state,
                            NSError *error) {
            [self sessionStateChanged:session
                                state:state
                                error:error];
        }];

Permissions I'm adding public_profile, but nothing happens differently.

aogilvie commented 10 years ago

@valodik This plugin should be working with FB app or without FB app, does not matter. i've not seen your problem before, did you resolve it?

andrewbusch7 commented 9 years ago

I'm also encountering this issue, and it's quite the problem for us. Specifically that login via browser works, but via iOS FB app it fails with "Error. Please try again later." Is there any way I can assist with resolving this problem? I'm currently using latest version of this plugin.

aogilvie commented 9 years ago

@andrewb273 please try some of the following:

http://stackoverflow.com/questions/7231939/redirecting-to-authentication-dialog-an-error-occurred-please-try-again-late

andrewbusch7 commented 9 years ago

@aogilvie Looked through those solutions but it's all already configured correctly. We currently have a live version of the app on iOS and Android working ok using phonegap-facebook-plugin v0.4.0, rather than the version I'm currently testing 0.10.1. Also that SO post seems to be for a website, rather than a cordova/phonegap mobile app.

aogilvie commented 9 years ago

@andrewb273 hmm check device system time and date on the phone is correct?

andrewbusch7 commented 9 years ago

@aogilvie date and time is all correct on the iPhone 4S I've tested with

aogilvie commented 9 years ago

@andrewb273

Some other things you can try:

andrewbusch7 commented 9 years ago

@aogilvie Thanks for the reply

In FacebookConnectPlugin.m on line 71, I'm getting error - code: 2

I'm not an Objective-C developer, so my ability to debug the code isn't quite there. We're going to get another person on our team to look into it a bit more.

aogilvie commented 9 years ago

@andrewb273 I can't recreate this but i'd love to know the error, can you try the following steps?

open Xcode and insert a breakpoint at this line (142) in FacebookConnectPlugin.m:

screen shot 2014-12-08 at 11 07 10 am

Start the app and wait for Xcode to pause at that section. Next observe the left console and drill down to find the NSError property and expand it (expand everything you can!), we are looking for an errorCode property and a localisedDescription property. Take a screenshot and paste here if you can (or copy text):

screen shot 2014-12-08 at 11 11 05 am

aogilvie commented 9 years ago

@andrewb273 Any updates?

andrewbusch7 commented 9 years ago

@aogilvie Apologies for the delay - the error code is 2. My error object seems to be a bit different to yours:

screen shot 2014-12-16 at 4 48 57 pm

The error almost always occurs with this specific account. It's a dummy FB account we set up - would it help if I provided you with the credentials? If so, let me know a way that I can privately send them to you.

aogilvie commented 9 years ago

@andrewb273 is that everything? :(

Code 2 can be quite a lot of things, here's a list:

andrewbusch7 commented 9 years ago

@aogilvie Ah looks like I've confused myself! I've been giving you info for the #479 bug that I'm also facing, instead of info on this bug. I'll make a post on #479 as that's more of a problem for us right now. Later on when I can, I'll provide info for #697.

phuongnm3 commented 9 years ago

Hi @andrewb273 and @aogilvie have you resolved this issue? we also run across this error but cannot resolve so far.

Really need your help :(

aogilvie commented 9 years ago

@phuongnm3 Not sure, i'll start creating lots of test accounts on Facebook next. Have not replicated the error yet :(