-1

So far I could open a PDF from anywhere on my iPhone and choose "Export to..." my app and then it started an import mechanism in my app.

I've implemented the Facebook SDK now and I assume it has to do with implementing this method:

- (BOOL)application:(UIApplication *)application 
            openURL:(NSURL *)url 
            options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {

  BOOL handled = [[FBSDKApplicationDelegate sharedInstance] application:application
    openURL:url
    sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
    annotation:options[UIApplicationOpenURLOptionsAnnotationKey]
  ];
  // Add any custom logic here.
  return handled;
}

So far I haven't implemented this method. And now I pasted this code into the app delegate. When I choose a PDF and select my app it opens my app, but nothing happens. I assume it has something to do with this? What do I need to change to being able again to open PDFs?

And what I also had to add was this in the info.plist

<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>fb{your-app-id}</string>
    </array>
  </dict>
</array>
<key>FacebookAppID</key>
<string>{your-app-id}</string>
<key>FacebookDisplayName</key>
<string>{your-app-name}</string>

Of course I already had some CFBundleURLTypes. And I just added the string within the array. Is this maybe the error?

MichiZH
  • 5,587
  • 12
  • 41
  • 81

2 Answers2

0

You need to handle the PDF where you see the comment // Add any custom logic here.. You must have deleted the old logic when you added this FB code. Check your old commit for the old logic and put it there.

Aaron Brager
  • 65,323
  • 19
  • 161
  • 287
-1

There can be possibility something is overwritten while adding FB key in info.plist