Opening all links from iPhone gmail app opens my app - ios

We have the odd situation where the iPhone app we've developed in Xamarin Forms is somehow intercepting all links in the Gmail app's emails, not just the links we intend our app to process. The user taps any link, and Gmail opens the link directly in our app instead of opening it in chrome or safari.
The only way to prevent this behavior is to go into Gmail settings and set Safari as the default browser.
Is this something that could be caused by an incorrect apple-app-site-association file?
This is the association file we are using for a domain where we process all paths in that domain. Other association files on other domains are more specific (specifying subpaths).
{
"applinks": {
"apps": [],
"details": [
{
"appID": "xxx.yyy",
"paths": [ "/", "" ]
}
]
}
}

We found the solution to the problem. A change had been made to the info.plist file in the iOS project, which caused our app to process Google Chrome links from Gmail. The googlechromes entry was the cause.
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>googlechromes</string>
</array>
</dict>
</array>

Related

MAUI IOS App universal links don't open my application

I am trying to start my MAUI IOS App using URI, but when I clicked on URL that must open my app nothing happen. I set a breakpoint into OpenUrl and ContinueUserActivity to check if its called, but its never called.
I created apple-app-site-association :
{
"applinks": {
"apps": [],
"details": [
{
"appID": "H9375ODJ26.com.example.testapp",
"paths": [ "/video/*"]
}
]
}
}
the file is accessible on https://www.example.com/.well-known/apple-app-site-association and it has content-type = application/json.
I have added in my Entitlements.plist this code:
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:example.com</string>
</array>
In developer.apple.com Associated domains option for my app is turned on.
Can anyone tell me what I'm missing ? I expect when I click on the URI, a pop-up will appear asking how to open the uri - browser or my ios app.
In Maui you can use Launcher to open other applications through URI. Apple requires that you define the schemes you want to use. Add the LSApplicationQueriesSchemes key and schemes to the Info.plist files:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>XXX</string>
</array>
Call the ILauncher.OpenAsync method and pass in a String or Uri representing the application to open:
await Launcher.Default.OpenAsync("xxx");
For more details, refer to:Launcher | Microsoft

Detailed Flutter Deep Links explanation?

I can't get any part of deep linking working in my Flutter app. None of the documentation I can find on this is anywhere near adequate. eg none mention this, but it appears https://developer.apple.com/documentation/xcode/supporting-associated-domains?language=objc that I need to provide a file on my server? Nor is there any discussion I can find of that or in what way I need to set up an associated domain.
May app on launch directs to the login page of a local copy of my website. Following login, my site redirects to myappname:mywebsite.
In my Info.plist, I have:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>mywebsite</string>
<key>CFBundleURLSchemes</key>
<array>
<string>myappname</string>
</array>
</dict>
</array>
Following a tip from someone on reddit (as I say, this stuff isn't documented anywhere!), I added an associated domain in XCode applinks:mywebsite?mode=developer
I also redirected my domain in my local hosts file to my local machine. I've verified in the browser in the iOS simulator that the domain redirect is working in the simulator.
It appears from Apple's documentation that I should see a hit on my website to .well-known/apple-app-site-association but I get nothing.
My app successfully redirects on launch to the login page, but when I complete the login, my site issues a redirect to myappname://mywebsite but the browser in the simulator is just ignoring this.
I opened the console on the device browser from Safari, but nothing is reported.

How to make deep links work in flutter when opened with gmail?

I am trying to implement deep linking in my flutter app. I am using the uni_links flutter package.
I am sending the deeplink for my application to the user's email account. However, in gmail, you need the http protocol in the href value, Otherwise gmail will not consider that as a valid link. Hence I am forced to use the following link in the email :
Click here
as opposed to a link like,
Click here
Now with https://myexample.flutter.dev, when I open the link from gmail, it doesn't open my app.
But, if I change my CFBundleURLSchemes key to myexample and CFBundleURLName to flutter.dev, when I type in myexample://flutter.dev in my browser, it opens my app. However, like I mentioned before, this is not recognized as a valid link in gmail.
What is the issue here? How do I resolve this?
Here's my ios/Runner/Info.plist :
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>myexample.flutter.dev</string>
<key>CFBundleURLSchemes</key>
<array>
<string>https</string>
</array>
</dict>
</array>
The first one is custom link you can do it by yourself
Click here
The second one is universal link
You need to provide file on the backend side to make it work.
Universal Links only work with https scheme and require a specified host, entitlements and a hosted file - apple-app-site-association.
Click here
UniversalLinksDocumentation
PS. I think right now as the end of the 2020 the best way to handle deeplinks is by Firebase Dynamic Links. Maybe future people will consider it it should be much more easier

IOS realease ITMS-90117: Missing routing app coverage file

My IOS app is using the map function for showing route and following is the map related configuration from info.plist
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>MKDirectionsRequest</string>
<key>LSHandlerRank</key>
<string>Default</string>
<key>LSItemContentTypes</key>
<array>
<string>com.apple.maps.directionsrequest</string>
</array>
</dict>
</array>
<key>MKDirectionsApplicationSupportedModes</key>
<array>
<string>MKDirectionsModeBike</string>
<string>MKDirectionsModeBus</string>
<string>MKDirectionsModeCar</string>
<string>MKDirectionsModePedestrian</string>
</array>
The app is only focusing on sweden, and following is the "sweden.geojson" file. Where coordinates start with longitude then latitude, with three brackets to close a polygon. Last coordinate is same as the first one.
{
"type": "MultiPolygon",
"coordinates": [
[[[9.755,54.977],[24.960,54.977],[24.960,69.565],[9.755,69.565],[9.755,54.977]]]
]
}
The initial json format validation passes, so I can do the submit, but then I got the emails with error: invalid binary, IOS realease ITMS-90117: Missing routing app coverage file. I even tried the sample json file from apple documentation but it is same error. Been on apple developer forum searching, but it is only problem posting, and no one posts any solution. Help appreciated...
This may or may not help you as I don't know the purpose of your app, but I had the same problem and and have found a solution that works for me.
I use MapKit to provide directions inside the app, but it isn't a directions app.
The solution was to turn off Map from the app capabilities (on the Signing and Capabilities tab). This setting indicates that the app works as a general purpose directions app.
I'm theorizing (but don't know for sure) that the reason the binary was invalid before I turned off the Map capability was that you can't have the capability enabled without providing a way to start the app with a location.

Allow opening my app from a link in a third-party app

I'm currently using a custom URL scheme to allow users to access my app (say, FoobarApp) from custom links (foobar://resource/42).
I set up the scheme like so :
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.acme.foobarapp</string>
<key>CFBundleURLSchemes</key>
<array>
<string>foobar</string>
</array>
</dict>
</array>
This works well when the users click the link in Safari.
Now I'd like them to be able to click said links in third-party apps (in my case Trello), to open my app.
This does not work, as the system (since iOS 9 if I'm not mistaken) now requires that apps whitelist URL scheme they want to query (with the LSApplicationQueriesSchemes in Info.plist).
(This is the message I get in the logs when I click the link in the third-party app:
iPad Trello(UIKit)[2368] : -canOpenURL: failed for URL: "foobar://resource/42" - error: "This app is not allowed to query for scheme foobar"
)
It's not reasonable to expect the third-party app to add my (enterprise) app's scheme to their LSApplicationQueriesSchemes list. Is their any option to "bypass" this protection? A kind of way to tell the system "It's fine, Trello can open my app"?
Summary
Custom app links foobar:// work in Safari
They don't work in third-party app (nothing happens, see log a few lines up)
How can I whitelist third-party apps so they can open my app?
an app has to tell ios it wants to query a url scheme. It has to declare this in its info plist at compile time!
There is no way around this on a apple allowed iPhone.
Sure when you jailbreak a phone, all can be done but... thats not a valid assumption either ;)
a workaround may be to link to a Website via HTTP and have the user open the app from there.

Resources