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.
Related
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.
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
I have been struggling with this for a few hours and couldn't confirm wether the following scenario is possible to achieve anymore or not.
Scenario : I am developing an app that deals (create, store ...) with files (image, video, pdf ..) and want to expose it as a viewer for these type of files to any other app in the device and mainly the photo library.
Current behaviour : my app is visible (and of course handling the files) when hit sharing from files browser on iPhone, google drive, one drive ... except the photo library. The only possible way I found to make it visible there is through creating a Share Extension which does not serve what I am attending to do since it is a limitation that Share Extension can not communicate with the app and attend to open it and pass the image path (or stream).
Here is my info.plist CFBundleDocumentTypes :
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>CFBundleTypeName</string>
<key>LSItemContentTypes</key>
<array>
<string>public.data</string>
</array>
</dict>
</array>
All I found so far is you just need CFBundleDocumentTypes to register your app in the device target apps for opening certain files (by types indicated by LSItemContentTypes). But no one has mentioned (I couldn't find one yet at least), why this sort of config won't get your app visible as a viewer when selecting share photo from photos library.
To Reproduce : just create a native iOS project via XCode or Xamarin.iOS project and introduce the above section into your info.plist. And of course run your app. You'll see it from files explorer, from safari trying to share a pdf to your file..., but not from photos library.
I was able to open apps from safari this way:
window.location = 'myapp://do/xx';
or open facebook app:
window.location = 'fb://';
But this stopped working in iOS9.
How can I open apps using URL schemes in safari?
IOS 9 URL Shchemes Update :
iOS 9 introduces LSApplicationQueriesSchemes to allow apps to query if other apps are installed.
1- If a url scheme is declared and calling canOpenURL(scheme)
YES if a installed app supports that URL scheme
NO if no app supporting that url
syslog will show canOpenURL: failed for URL: "urlScheme://" - error: null
2- If a url scheme is not declared and calling canOpenURL(scheme)
always return NO
syslog will show canOpenURL: failed for URL: "urlScheme://" - error: null
In iOS 9, the developer must add these info.plist
LSApplicationQueriesSchemes
<array>
<string>urlscheme</string>
<string>urlscheme2</string>
<string>urlscheme3</string>
<string>urlscheme4</string>
</array>
50 max. unqiue URL scheme can be declared!
With iOS9, Apple is changing a few things concerning URL schemes. Here is an article about those changes.
Basically, you now have to register all URL schemes that are supported by your app in your .plist file.
With the general release of ios9 setting window.location to a custom url does launch the app, but only after the user hits open in a popup. I filed a bug with apple about this, and they responded saying that it was intended behavior for launching an app from safari. They said they would look into the issue where if you hit cancel it fails out on future attempts.
Just assign a desired address to the href property, instead of trying to replace the whole window.location object:
window.location.href = 'myapp://do/xx';
It works for me on iOS 9.0.2, but now safari shows a confirmation dialog to ensure а user really wants open your link in the app.
this is how I have revised my Facebook/Google Login integration to get it work on latest update. which now user Safari web view.
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
<string>com.googleusercontent.apps.39373238582-opjuqokmar2i5t3sdk2vs5sifer4moen</string>
<string>com-google-gidconsent-google</string>
<string>com-google-gidconsent-youtube</string>
<string>com-google-gidconsent</string>
<string>com.google.gppconsent.2.4.1</string>
<string>com.google.gppconsent.2.4.0</string>
<string>googlechrome</string>
<string>googlechrome-x-callback</string>
</array>
I am submitting my app to the app store which uses location services (GPS dot) and MKPinAnnotations and doesn't use anything else for a map, and it looks from what I have researched that the Routing Coverage File is used for overlays?
I dont think I need a Routing Coverage File, but when I go to publish, xcode errors out saying it is missing in the Itunes Connect.
The category for the app is Utilities. It was also navigation but I unticked this hoping it would solve the issue and it didn't.
How can I get around this?
I had the exact same issue earlier today when trying to publish an application that uses the MapKit but does not offer routing capabilities. I resolved it by deselecting all supported routing modes under '{Target} --> Capabilities --> Maps'. If you are just looking at the Info.plist file then you can remove the the MKDirectionsApplicationSupportedModes key and the CFBundleTypeName key that equals MKDirectionsRequest.
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<!--Remove both of these key/value pairs -->
<key>CFBundleTypeName</key>
<string>MKDirectionsRequest</string>
<key>LSItemContentTypes</key>
<array>
<string>com.apple.maps.directionsrequest</string>
</array>
</dict>
</array>
and
<key>MKDirectionsApplicationSupportedModes</key>
<array>
<string>MKDirectionsModeBike</string>
<string>MKDirectionsModeBus</string>
<string>MKDirectionsModeCar</string>
<string>MKDirectionsModeFerry</string>
<string>MKDirectionsModeOther</string>
<string>MKDirectionsModePedestrian</string>
<string>MKDirectionsModePlane</string>
<string>MKDirectionsModeStreetCar</string>
<string>MKDirectionsModeSubway</string>
<string>MKDirectionsModeTaxi</string>
<string>MKDirectionsModeTrain</string>
</array>
turn off map capability solved my problem,
xcode - next to general tap, you should see capability tab,
scroll down to maps section, turn it off,
general tab, change you build and version different from last time,
re-upload to app store.
This time it would not ask for routing profile coverage file,
Done.
This took me a long time to figure out, but the problem was with my scheme. It was the routing app coverage file location. I just change it to "None". Go to your scheme -> Edit Scheme -> Run -> Options -> Routing App Coverage File, change it to None.
see here