0

I am integrating Fitbit into my react-native app and there is a piece of code that I should add to my AppDelegate.m:

#import "RCTLinkingManager.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
 openURL:(NSURL *)url
 sourceApplication:(NSString *)sourceApplication
 annotation:(id)annotation {
 return [RCTLinkingManager
 application:application
 openURL:url
 sourceApplication:sourceApplication
 annotation:annotation];
 }

but I already have that set up that handles FB login and firebase linking and maybe something else:

- (BOOL)application:(UIApplication *)app
 openURL:(NSURL *)url
 options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
 if ([[FBSDKApplicationDelegate sharedInstance] application:app openURL:url options:options]) {
 return YES;
 }
 if ([RCTLinkingManager application:app openURL:url options:options]) {
 return YES;
 }
 return NO;
}

and when I'm trying to combine them into that:

 - (BOOL)application:(UIApplication *)app
 openURL:(NSURL *)url
 options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
 sourceApplication:(NSString *)sourceApplication
 annotation:(id)annotation{
 if ([[FBSDKApplicationDelegate sharedInstance] application:app openURL:url options:options ]) {
 return YES;
 }
 if ([RCTLinkingManager application:app
 openURL:URL
 options:options
 sourceApplication:(NSString *)sourceApplication
 annotation:(id)annotation ]) {
 return YES;
 }
 return NO;
 }

I'm getting the error: No known class method for selector 'application:openURL:options:sourceApplication:annotation'

Is it mean that sourceApplication and annotation are already included into options?

Any help welcome

asked Dec 15, 2020 at 13:39
0

1 Answer 1

0

you should call the FBSDKApplicationDelegate differently:

 if ([[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation]) {
 return YES;
 }
answered Dec 15, 2020 at 13:55
Sign up to request clarification or add additional context in comments.

3 Comments

I need to change the part with LinkingManager, not with FBSDKApplicationDelegate
there is a typo in your call, you entered URL, but it should be url.
yes, it was a typo here, FBSDKApplicationDelegate worked good

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.