Open in "(null)"? dialog in iOS 9 - ios

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.

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"?.

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.

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.

Related

Can't make Apple Sign In work with Xamarin.Essentials

I know this might not be the best question, not much information, but I will try.
I'm trying to add Apple Sign In to Xamarin.Forms app using Xamarin.Essentials. As of now, I'm just trying to make it work on iOS 13, without going any further yet, server side is not required as I understand for this limited scope.
I looked into the sample app for Xamarin.Essentials, and came to conclusion that specifically for iOS 13 it would be enough to call
await AppleSignInAuthenticator.AuthenticateAsync();
However, I got an exception "com.apple.AuthenticationServices.AuthorizationError error 1000". Couldn't fine more details.
Then I took Xamarin.Essentials sample app, changed Bundle Id to what I have in my app, and then it worked. This validated that certificates and App store were configured correctly.
I tried to get Xamarin.Essentials from GitHub and debug through the library, the exception is in AppleSignInAuthenticator.ios.cs in "PlatformAuthenticateAsync", at the line
var creds = await authManager.Credentials;
Update: In entitlements.plist I added
<key>com.apple.developer.applesignin</key>
<array>
<string>Default</string>
</array>
Any help or advise is appreciated.
I new it would be something stupid.
I have Entitlements.Development.plist and Entitlements.Production.plist. Should I say more (didn't add key for com.apple.developer.applesignin everywhere).
BTW, how people handle it, to have separate value for key aps-environment between development and production?

-canOpenUrl OSStatus fout -10814

I'm trying to open an app from my own app that is also installed on my iPhone called KIJK. I've added the kijk string to the array in the Info.plist and am calling the -canOpenUrl method but it always fails.
I get this error message:
OSStatus fout -10814
Now I'm wondering, in Safari it is possible to open the KIJK app with a link that is made up like this: kijk://serie/123311 so I assumed kijk was the query I needed to add in my plist file.
Is there a way to find out the app scheme of an app I didn't develop? I checked a lot of answers already but they all seem outdated because of new iOS or iTunes versions.
<key>LSApplicationQueriesSchemes</key>
<array>
<string>kijk</string>
<string>rtlxl</string>
<string>npo</string>
</array>
Q: Is there a way to find out the app scheme of an app I didn't develop? I checked a lot of answers already but they all seem outdated because of new iOS or iTunes versions.
There is no way for you to find out the URL Schemes of another app until unless they declare. For example, Facebook, Uber, etc. Click the link to see Facebook apps URL Schemes.
https://developers.facebook.com/docs/ios/ios9 => Whitelist Facebook Apps
Q:Now I'm wondering, in Safari it is possible to open the KIJK app with a link that is made up like this: kijk://serie/123311 so I assumed kijk was the query I needed to add in my plist file.
If the KIJK app had URL scheme with the format like "kijk://" then it will open the app. Otherwise, it is not going to open the app.
I guess you might be aware of the rule that from iOS 9 you need to whitelist the schemes your app will query using canOpenURL.

Opening Instagram app from a link on iOS

I am providing a feed which is consumed by both desktop and mobile apps which contains links to images, users, and tags on Instagram. When these links are clicked on iOS, I want them to open in the Instagram app.
Currently if I have a link like this:
https://www.instagram.com/p/BK8f1rigadE/
If I click it in iOS, the Instagram app does open, just briefly. It then seems to launch Safari to the page, which includes an "open in app" link to open it back up in the app. That link uses the "instagram://" protocol to trigger the app to open. I'm aware of that method, but that's not what I'm after.
I'm on iOS 10 with the latest Instagram app. I feel like this used to work, so I'm wondering if it's just a bug in iOS or Instagram that will be fixed eventually.
Links to twitter.com open properly in the Twitter app... that's the kind of behavior I'm after.
I found a service called URL Genius (via this blog post) that solves this exact problem, and provides click metrics, too.
I don't like relying on an external service for such an important link, but it's easy, works well, and the basic service is free. I will probably set a reminder for myself to check that this still works every month or so...
Links like this work to open the app:
instagram://media?id=1346423547953773636_401375631
However I want a regular http link, which opens a browser on desktop, and the app on mobile. Not sure if it exists.
From my knowledge, the only supported links into Instagram are described here
I'm not sure what the link you're attempting to use represents: /p/id_here seems like a post? You likely need to use:
https://www.instagram.com/media?id=id_here
The documentation I linked shows the "deeplink" approach (instagram://) which I understand you're avoiding, but the same paths should work through the Universal Link approach, at least from my experience.
Had the same problem. For me was solved by simply uninstalling and reinstalling the problematic app.
(Instagram 171.0 - iOS 14.3 - iPhone 11 Pro)
On iOS you must first add the instagram url scheme in the LSApplicationQueriesSchemes key of the info.plist file:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>instagram</string>
</array>
then you can open the url of the post using the link:
instagram://media?id=POST_MEDIA_ID
POST_MEDIA_ID can be found by looking at the page source, you will find a tag like this:
<meta property="al:ios:url" content="instagram://media?id=POST_MEDIA_ID"/>
Obviously, the Instagram app must be installed on the device, otherwise the link will not work.

Firebase dynamic link not opening the app iOS

I have developed & installed an iOS app locally on my device.
And have set custom scheme in the info.plist as mydlink
Set associated domains as weel: applinks:<myapp>.app.goo.gl
Created dynamic link on firebase as:
https://<myapp>.app.goo.gl/?link=http://<mysite.com>/&ibi=<app bundle id>&ius=mydlink&ifl=https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id%3D<app store id>%26mt%3D8&pt=<app store id>
When I open or click on dynamic link, it opens app page in the "App Store" app and not opening app itself though its installed.
What am I missing here?
sometimes we make a mistake in Associated Domains entitlements. There have to be no spaces
applinks:mydomain.page.link
If you are on iOS 9, universal links will be used. Universal links don't work in a lot of cases, like:
If you use a simulator
If you try to open the link directly in safari on a device (typing it into the address field in the browser)
I spent a lot of time trying this and could never get it to work on a simulator in a reliable way. What I end up doing is emailing the link to me and opening it from Inbox. Then it works every time!
I had an issue using iOS 14, running on device in debug mode.
Link has always redirected me to the AppStore app not to my app.
The solution was to enable "Associated Domains Development" on iPhone Settings>Developer>Associated Domains Development
(found it here: https://stackoverflow.com/a/63939770/6689321 ).
I'm sorry for the late reply - I hope your issue has been resolved and that this is helpful to others who may be experiencing the same problem.
There could actually be one or more issues here for iOS 9+; Dynamic Links relies on Apple's Universal Links to open the app on iOS 9+ and these suggestions are aimed at resolving issues with Universal Links and Firebase and have nothing to do with the SDK directly.
Verify that the assoc file is correct at https://app_id.app.goo.gl/apple-app-site-association - it should look similar to https://maps.app.goo.gl/apple-app-site-association but with only one element in "details."
As pointed out by another answer, verify that your team ID is properly set in the Firebase console.
If you've long-pressed the link and then clicked "Open in Safari" or you have clicked the "goo.gl>" button on the status bar of your app after the app opens via a Universal Link, then iOS defaults to opening Universal Links in Safari. This can be fixed by pulling down on the paged opened in Safari and clicking "Open in App" (or similar) on the smart banner.
The "ibi" parameter is not involved in opening the app in a post-install click on iOS 9+, but is in prior versions when the "ius" param is not set.
Regarding iOS 8, can you try running the app and then clicking a link after the app is installed? On versions prior to iOS 9, you can test by copy/pasting the link into safari.
https://firebase.google.com/docs/dynamic-links/ios
Just in case there is still someone out there having this issue, please note the following
Dynamic links now opens on simulator, please copy your link and paste on safari in your emulator.
Chrome and safari opens dynamic differently, safari uses only universal linking while chrome uses both url scheme and universal linking to open dynamic link. Ultimately you should try to get dynamic linking opening via universal link in your app.
If your dynamic link routes to App Store instead of opening your app. there is an issue with your universal link. You can temporarily test using chrome.
To set up opening dynamic link via universal link, please check the following
Ensure your Team id is correctly set In firebase console, get your team id from your membership detail in https://developer.apple.com
Ensure your domain is listed in your associated domain as shown below, no space between the domain
Ensure Associated domain is turned on in your apple developer account
if you are using a custom domain, ensure you add it to the info.plist as shown below.
I make a mistake that not setup Associated Domains for DEBUG, so make sure you setup Associated Domains all both DEBUG & RELEASE
I experienced same problem. Interestingly if you open the dynamic link in Chrome, app starts directly and successfully. But in Safari always it tries to open AppStore although the app is installed. I have no idea why Safari doesn't work in this case.
If none of the above workarounds work for you, please check if you have added activitycontinuation in associated domains or not.
Firebase dynamic links were not working for us (on iOS9 where they use universal links) due to a problem in Firebase's assumptions during setup. Here's how we fixed the problem on our app:
Firebase asks for your "Team ID" when adding your iOS app to Firebase Console Project Settings, and it assumes that your unique app ID will be in the format TeamID.com.foo.bar
However, in our case, that was NOT our unique app ID. When I looked at our provisioning profile (on developer.apple.com I found our provisioning profile and clicked "edit"), I saw that our unique app ID was actually SomethingElse.com.foo.bar
I had to go into Firebase Console and enter that "SomethingElse" in the spot where it asked for Team ID, even though that was NOT our team ID. Once I made that change, Firebase Dynamic Links started working correctly.
It appears Firebase is making an assumption that your unique app ID will always start with your Team ID, which is apparently not always the case.
Note that changing your Team ID can take a significant amount of time to take effect. You can see that the change has happened by checking the appropriate link for your app_id (https://app_id.app.goo.gl/apple-app-site-association).
After integrating Firebase Dynamic links, the sample link started working immediately on a device with iOS 8. For iOS 9 devices Universal links mechanism is used, as mentioned by other answers. This means Apple needs to update the entitlement data used to verify deep link dual authentication. This may take 48 hours, according to Apple's App Search API Validation Tool.
There are more Universal links troubleshooting tips here.
Experienced the same problem.
The solution for me was to use the
Identifiers -> App IDs -> 'my.app.ID' -> Prefix
You can find it on: https://developer.apple.com/account/ios/identifier/bundle
Instead of the 'DevelopmentTeam' number from the .pbxproj which I used and add it to the Team ID for my iOS app in the Firebase console.
And don't forget to download and add a new .plist to the project.
i had same issue with latest flutter sdk and firebase dynamic links plugin.
Tried all solutions the only fix was to manually insert com.apple.developer.associated-domains key to ios/Runner/Running.entitlements file
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:abc.page.link</string>
</array>
I have great news.
I always hear that it's IMPOSSIBLE to test a dynamic link on simulator.
But now WE CAN test firebase dynamic link on simulator
https://stackoverflow.com/a/56385506/6273003
When link is open in safari, It shows a "open (project name)"button. If this button is pressed for 2-3 second, It asks for opening that into different apps for first time.It also shows your app name. If you select your app, It opens your app. After doing that if you again open this link and press button in safari, it always work fine.
This fixed the problem for me.
After completing the setup in Firebase and in the Xcode project.
Add below code inside SceneDelegate instead AppDelegate.
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
if let incomingURL = userActivity.webpageURL {
print("Incoming URL is \(incomingURL)")
let linkHandled = DynamicLinks.dynamicLinks().handleUniversalLink(incomingURL) { (dynamicLink, error) in
guard error == nil else{
print("Found an error! \(error!.localizedDescription)")
return
}
if let dynamicLink = dynamicLink {
self.handleIncomingDynamicLink(dynamicLink)
}
}
}
Set on your Xcode project the correct form to declare Associated Domain, you must to include applinks:
Make sure you have a Team Id set in the firebase console for you app. (you will then need to download and import the .plist file).
This fixed the problem for me.
We had a similar problem. The issue in our case was that the software that generated the emails with the links generated a new link that had a 304-redirect to our deep link. This did not work in Safari (but in Chrome).
Check that your deep link is actually the first link opened when you click the link in the email.
i had same case and it fixed with after defined ios app on deeplink url;
Dynamic Links -> choose your link -> Edit
make sure that you have defined ios app;
I had the problem, that the AASA file was different at the locations
[domain]/.well-known/apple-app-site-association
[domain]/apple-app-site-association
The validator from branch always checks the file on the non well known path. It was confusing because it always said it was all fine even though is was not.
For Firebase, check your hosting and search in the public dir for a .well-known folder. In my case, I could just delete it, run firebase deploy --only hosting and let Firebase generate all AASA files for me.
https://branch.io/resources/aasa-validator/
If you are sure all your dynamic links config in xcode is correct, link is good, but it still opens Appstore you can try this trick:
Copy the link and paste it into the notes app
Long press on the link in notes to see context menu
If you see button "Open in YourAppName" - try pressing it.
please check associated domains as well: applinks:.app.goo.gl is correct or not? and Dynamic link is easily work on iOS Simulater , I don't get any issues.

iOS application ExternalHosts

I'm developing an app using phonegap/cordova (1.7.0), I can't figure out how to make my application work with a less restrictive option than *. If I try setting www.mywebservicedomain.com or *.mywebservicedomain.com it can't retrieve data anymore. I see many questions about this and the general answer is to just set *. I'd like to understand how to be more restrictive, if it is possible.
Thank you in advance for your efforts.
That is indeed possible. But be aware that redirects on the servers may lead to connections to different domains which you also have to specifiy. Luckily those restricted accesses appear in the debug log in xcode. Run the project on the simulator or the device from within xcode and then you will see which requests to which servers got blocked.
In the cordova.plist it should look like this:
<key>ExternalHosts</key>
<array>
<string>*.googleapis.com</string>
<string>*.gstatic.com</string>
</array>
I use Google maps in my project which uses the described redirect. Thus I had to add the gstatic although my requests point to maps.googleapis.com originally (I use cordova 1.7).

Resources