react-native-facebook-login
react-native-facebook-login copied to clipboard
Duplicate declaration of method 'application:openURL:sourceApplication:annotation:'
Hello Team,
I'm using react-native-facebook-login library for facebook login but facing problem this Duplicate declaration of method 'application:openURL:sourceApplication:annotation:' because I have also included react-native-google-signin so what can I do
im assuming this is IOS due to my unfamiliarity.
if it can me namespaced then you can submit a PR with it working to resolve duplication
I have corrected this by some manipulation and take help of an article its works (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { if([[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation]) { return YES; }
return [RNGoogleSignin application:application openURL:url sourceApplication:sourceApplication annotation:annotation]; } For more details
http://stackoverflow.com/questions/35537179/how-do-i-fix-duplicate-declaration-of-method-with-out-breaking-code
BOOL handledGoogle = [RNGoogleSignin application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation];
BOOL handledFacebook = [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation];
return handledFacebook || handledGoogle;
is how to correctly handle it ( i think )
Hi, I'm using this
-
(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { if([[FBSDKApplicationDelegate sharedInstance] application:application openURL:url
sourceApplication:sourceApplication
annotation:annotation]) { return YES; }
if([RCTLinkingManager application:application openURL:url sourceApplication:sourceApplication annotation:annotation]) { return YES; } return [RNGoogleSignin application:application openURL:url sourceApplication:sourceApplication annotation:annotation]; }
On Wed, Oct 19, 2016 at 9:18 PM, Ryan Stegmann [email protected] wrote:
BOOL handledGoogle = [RNGoogleSignin application:application openURL:url sourceApplication:sourceApplication annotation:annotation]; BOOL handledFacebook = [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation]; return handledFacebook || handledGoogle;
is how to correctly handle it ( i think )
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/magus/react-native-facebook-login/issues/144#issuecomment-254854658, or mute the thread https://github.com/notifications/unsubscribe-auth/APpuJYpeoDuHUZoEXGcnc4fGYkaMED-oks5q1jvZgaJpZM4Jg_Nk .
Thanks,
Asheesh Kumar Sahu Software Engineer(Apps) uCertify
I have a similar issue with the following code (found here) i'm supposed to add to AppDelegate.m:
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[FBSDKApplicationDelegate sharedInstance] application:application
didFinishLaunchingWithOptions:launchOptions];
// Add any custom logic here.
return YES;
}
The error is Duplicate declaration of method 'application:didFinishLaunchingWithOptions:'
I have so many questions on this, this is way too complicated for something that should be very easy. The name of the function didFinishLaunchingWithOptions suggest that this should return either true or false, but it always returns YES which I suppose means true.
Therefore, what does the following code do? Why does this function have side effects despite having a name that suggest otherwise (I suppose this piece of code does have side effects otherwise it would be useless)? Or maybe it can raise exceptions (some kind of assertion)?
[
[FBSDKApplicationDelegate sharedInstance]
application:application
didFinishLaunchingWithOptions:launchOptions
];
Can I just move this part of the code in the existing didFinishLaunchingWithOptions and ignore instructions order?
Finally, why are codes in objective-c indented in such an unreadable way?