I've sifted through the various other posts regarding openURL not being called and none of them apply to my case, so here's another.
I am trying to implement deep linking. I am able to open the app from a link, so my url scheme works. However, the openURL method never gets called.
I'm on iOS 8.
If I remove the MainWindow.xib I get a black screen (haven't sorted out the details of programming it in), but the openURL method gets called when it should.
My company isn't exactly the project's owner, so ideally there would be a way to make the openURL work with MainWindow.xib or show some document stating that this is not supported.
code: in my applicationdelegate.m:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
NSLog(@"open %@",url);
return YES;
}
and in info.plist:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.something.appish</string>
<key>CFBundleURLSchemes</key>
<array>
<string>schemename</string>
</array>
<key>CFBundleURLTypes</key>
<string>Viewer</string>
</dict>
</array>
The links i use are schemename://anything and com.something.appish://anything
These open up my app or bring it to the forefront, but do not result in an openURL call.
previous posts on the subject include:
- openURL should be defined in the application delegate, not view controller.
- try handleOpenURL (for earlier iOS versions).
- url scheme not defined correctly.
- app not installed case.
- trying to open particular files.