React Native Facebook Login iOS AppDelegate inheritance from Expo class

105 Views Asked by At

I am working through the steps to add Facebook login to my react native iOS app. I am using react-native-fbsdk-next. The documentation says slightly different things in different places. In one place it says to put this into didFinishLaunchingWithOptions:

[[FBSDKApplicationDelegate sharedInstance] application:application
                   didFinishLaunchingWithOptions:launchOptions];

In my case, my AppDelegate class is actually a subclass of EXAppDelegateWrapper, which I assume is a class provided by Expo (this is an ejected Expo app). So my AppDelegate didFinishLaunchingWithOptions method already has a call to its superclass counterpart:

[super application:application didFinishLaunchingWithOptions:launchOptions];

So my question is this: do I add the FBSDKApplicationDelegate version after the superclass call? Or in place of it?

There is also a problem with the application:openURL:options: method. The original code also calls the superclass method:

if ([super application:application openURL:url options:options]) 
{
  return YES;
}

if ([RCTLinkingManager application:application openURL:url options:options]) {
  return YES;
}

return NO;

So where do I put this:

if ([[FBSDKApplicationDelegate sharedInstance] application:application openURL:url options:options]) {
  return YES;
}

Does this go before or after or in place of the call to the superclass method?

Also in iOS 13, the URL functionality was broken out into a SceneDelegate, but my expo code (originally created for iOS12 but now requiring iOS13+) only has AppDelegate. Is this going to be a problem?

0

There are 0 best solutions below