1

So I'm trying to add a custom URL scheme to my app. Everything works. The confusing part is that when a user gets redirected it puts up a dialog box that says:

Open in "(null)"?

I can't figure out why it says null and not the name of the app. The only other spot I've been able to see this issue mentioned is here:

'Open this page in "null"' Modal appearing from FacebookSDK login after iOS9 and Swift 2 upgrade

but that talks about updating to the latest SDK. It does mention whitelisting the scheme which I tried doing using LSApplicationQueriesSchemes but that doesn't seem to fix it either.

Community
  • 1
  • 1
Brian F Leighty
  • 922
  • 11
  • 22

3 Answers3

2

So in my case it ended up being that the following had gotten added to my Info.plist:

<key>CFBundleDisplayName</key>
<string></string>

Either removing this key or giving it a non empty string value fixes the issue and causes it to give: Open in "name of app"?.

Brian F Leighty
  • 922
  • 11
  • 22
1

The value in that dialog is specified in Build Settings -> Packaging -> Product Name. By any chance, is that field somehow blank? Usually the build should fail if so, and presumably you'd have also noted something wrong on the homescreen, but who knows!

As a side note, URL schemes are not a fool-proof way to handle deep linking anymore, and are actually actively discouraged by Apple. At minimum, you also need to implement Universal Links, but even that is not a complete solution because of variations in how other apps (Facebook, etc) handle outbound links. You may want to consider a tool like Branch.io (full disclosure: I'm on the Branch team) to give a hand with all the logistics.

Alex Bauer
  • 13,147
  • 1
  • 27
  • 44
  • 1
    Thanks for the input. I checked the product name and as expected it is correct. I looked into universal links but in this case there is no website page that I would take them to. It's for Oauth authentication and so it only should go back to the app. In my testing it seemed to sometimes work sending it to the app and sometimes not where as other than this weird message the URL scheme method works correctly every time. – Brian F Leighty Jun 29 '16 at 19:56
  • Hmm...nothing else comes to mind immediately. Have you tried Product -> Clean? – Alex Bauer Jun 29 '16 at 21:10
  • Just tried again to make sure I had and yes same thing. – Brian F Leighty Jun 30 '16 at 15:51
0

I found this about whitelisting urlschemes for iOS 9 (found answer here)

Any app built with SDK 9 needs to provide a LSApplicationQueriesSchemes entry in its plist file, declaring which schemes it attempts to query.

<key>LSApplicationQueriesSchemes</key>
<array>
 <string>urlscheme</string>
 <string>urlscheme2</string>
 <string>urlscheme3</string>
 <string>urlscheme4</string>
</array> 

This worked for me in getting rid of that.

Community
  • 1
  • 1
heLL0
  • 1,357
  • 3
  • 23
  • 30
  • Thanks heLL0. As you can see in my question, I did try adding LSApplicationQueriesSchemes but that didn't fix it for me. That seems to deal with calling a urlscheme from within the app which I'm not doing. I'm calling the url scheme from Safari. What problem did adding this solve for you? – Brian F Leighty Jul 01 '16 at 15:54