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?