I'm trying to open my Application from a SMS like when I receive an address and when i tap on it, open Plans. I receive also a SMS from server with this : a.doctolib.fr/hnFZ8k5sr who opens directly the application Doctolib. Is somebody knows how to do that?
I saw the answer : Opening app from sms and getting the sms contents in iOS but when i look at my sms, it's ok, that's run... thanks by advance!
Opening app from sms and getting the sms contents in iOS
You should be searching on how to open to your app from SMS using url scheme.
These links can help you:
Open app from SMS with my url scheme as a link
https://web.archive.org/web/20110222053023/http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
You can use Universal link, If the app is installed, app will be opened otherwise will continue to the browser.
Steps to support universal links-
Create your apple-app-site-association file(Suppose your universal link is www.abc.com/getapp and you want to redirect in your app from here).
{
"applinks": {
"apps": [],
"details": [
{
"appID": "9JA89QQLNQ.com.apple.wwdc", //9JA89QQLNQ is your team ID & com.apple.wwdc is your bundle id
"paths": [ "/getapp"]
}
]
}
}
Upload this file to the root directory of there server where www.abc.com is hosted(from where you need to redirect to your installed app).
e.g- Suppose you have to redirect from www.abc.com/getapp then you need to upload the apple-app-site-association file to the root directory where the www.abc.com is get hosted.
Validate at http://branch.io/resources/aasa-validator/. If the file is valid then all checks would be green.
Now prepare your app to support universal links-
a. Go to developer.apple.com and enable Associated Domains to your app ID.
b. Select your target and turn on Associated Domains switch.
c. Add applinks:abc.com.
d. Add application:continueUserActivity:restorationHandler: app delegate method so that your app can receive a link and handle it appropriately.
Not getting callback to the app-
1.When a user is browsing your website in Safari and they tap a universal link to a URL in the same domain as the current webpage, iOS respects the user’s most likely intent and opens the link in Safari.
2.Copy and paste your universal link(http(s)://www.abc.com/getapp) to notes and tap on it. It your app can handle this link you will get the option Open in "AppName".
References-
https://gist.github.com/anhar/6d50c023f442fb2437e1
https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html
Hope it may help.
Related
I have implemented BranchI to handle universal links, I have been through the documentation and as far as I can everything should work.
The behaviour I get is that when I long press and select open with 'myApp' from the menu all is fine and works as expected.
However if I simply click the link, the app will open as expected but the Branch Universal object does not have the data that the the link should be passing through. I have emailed Branch support but they have not replied for days.
Would appreciate help from anyone who has also experienced this issue.
I am running an app deployed to iOS14 using SwiftUI , but I do have an appdelegate, where I am calling the Branch Universal object in UIApplicationDidFinishWithOptions.
Many thanks
In your app under Signing & Capabilities you have to add the domain you want to open in your app as Associated Domain. So you add the Associated Domain capability and add your domain as applinks (eg "applinks:casperzandbergen.nl").
This lets iOS know your app wants to handle those links. But iOS also asks the server if an app is allowed to handle that domain so no one else could make an app to hijack traffic to my domain.
To let iOS know an app is allowed to open urls from your domain you have to host an entitlements file on your server with details of what apps can open exactly which paths.
Specifically you host your entitlement json at https://<the domain in your capabilities>/.well-known/apple-app-site-association
For example I have this hosted:
{
"applinks":{
"apps":[],
"details":[
{
"appID":"<app id including team id>",
"paths":["/*"]
}
]
}
}
And this works but the new syntax described by apple is different:
https://developer.apple.com/documentation/xcode/supporting-associated-domains
Please make sure that you added Associated Domain capability In your app under Signing & Capabilities you have to add the domain you want to open in your app as Associated Domain.
For Example
applinks:www.amazon.com
This is enough from client side app. But some apps will try to steal traffic of may websites by this dynamic links, so apple required to add apple-app-site-association to verify the server.
Associated domains establish a secure association between domains and your app so you can share credentials or provide features in your app from your website.
Host your apple domain entitlement json at https://yourdomine.com/apple-app-site-association
The following JSON code represents the contents of a simple association file.
{
"applinks": {
"details": [{
"appIDs": ["ABCDE12345.com.example.app", "ABCDE12345.com.example.app2"],
"components": [{
"/": "/buy/*",
"comment": "Matches any URL whose path starts with /buy/"
}
]
}]
},
"webcredentials": {
"apps": ["ABCDE12345.com.example.app"]
},
"appclips": {
"apps": ["ABCED12345.com.example.MyApp.Clip"]
}
}
You can see apple-app-site-association in Netflix and Youtube Here.
Apple documentation for associated domains Click Here
You will get a call in func scene(_ scene: UIScene, continue userActivity: NSUserActivity){} in or in AppDelegate corresponding method once you successfully integrated it.
I want to redirect Users to my iOS application when they type a specific domain (one I control) in to the address bar.
I have my apple-app-site-association file:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "TEAM_ID.bundle_identifier",
"paths": [ "*" ]
}
]
}
}
This is uploaded to my server running HTTPS, sitting inside of a .well-known directory in the root of my server.
On XCode, I have linked the Associated Domains and just added applinks:example.com (for now).
When I email myself the link and click it, my application opens perfectly. How do I extend it further to allow the app to open when clicking on a link in Safari?
I want to enable a sharing mechanism whereby a User clicks a link on Twitter Mobile Web (for example) and my application opens.
Edit: I've got URL Types set up but of course it requires a User/site to redirect to example:// - this isn't what I want to achieve.
Safari should handle Universal Links but they have a limitation of opening the app when you are already on the same domain. For example, if you are on example.com and click on a Universal Link example.com/deep/link/path. It will stay on the browser.
This is why Branch uses 2 URLs. example.app.link and example-alternate.app.link so when you click on a link when already on the website you are still taken to the app.
Also, typing a Universal Link into Safari does not work. It must be tapped.
Where can I upload 'apple-app-site-association' for universal link setup in my iOS app?.
How can I use universal link in my iOS app?. I am getting just confuse to read a lot of tutorials. Can anyone help me?
You need to upload apple-app-site-association file to the root directory of the server(from where you need to redirect to your installed app).
e.g- Suppose you have to redirect from www.abc.com/getapp then you need to upload the apple-app-site-association file to the root directory where the www.abc.com is get hosted.
Steps to support universal links-
Create your apple-app-site-association file(Suppose your universal link is www.abc.com/getapp and you want to redirect in your app from here).
{
"applinks": {
"apps": [],
"details": [
{
"appID": "9JA89QQLNQ.com.apple.wwdc", //9JA89QQLNQ is your team ID & com.apple.wwdc is your bundle id
"paths": [ "/getapp"]
}
]
}
}
Upload this file to the root directory where www.abc.com is hosted.
Validate at http://branch.io/resources/aasa-validator/. If the file is valid then all checks would be green.
Now prepare your app to support universal links-
a. Go to developer.apple.com and enable Associated Domains to your app ID.
b. Select your target and turn on Associated Domains switch.
c. Add applinks:abc.com.
d. Add application:continueUserActivity:restorationHandler: app delegate method so that your app can receive a link and handle it appropriately.
Not getting callback to the app-
1.When a user is browsing your website in Safari and they tap a universal link to a URL in the same domain as the current webpage, iOS respects the user’s most likely intent and opens the link in Safari.
2.Copy and paste your universal link(http(s)://www.abc.com/getapp) to notes and tap on it. It your app can handle this link you will get the option Open in "AppName".
References-
https://gist.github.com/anhar/6d50c023f442fb2437e1
https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html
Hope it may help.
First of all, I know how to make custom schemes in iOS and I know how to open my app from a website using a javascript setTimeout method.
I have an app that uses custom URL scheme and it is working great. What it does is, it sends a http://testsite.com/QueryStrings message to other users in the contact list (predefined) and on clicking those web links in the sms, these things happen:
Open the link in Safari
Open the app if installed with custom url using setTimeout
If not installed, move to the normal website page
What I wanted actually is to open my app directly from SMS if installed but for that I have to send my custom url scheme in the SMS, that is not an option because if app is not installed then this SMS wont work so a weblink is the only option for now.
Today, I installed SoundCloud and accidentally noticed this thing is that when http:// m. soundcloud .com /... url is sent in an SMS and on clicking the link it opens the app (if installed) directly not the Safari (Strange for me).
So I was wondering how come their app open from a web link without opening the Safari. I googled it around but I couldn't find a solution to my problem. I am attaching a screenshot too from my mobile where press and hold on the link in the messages app give Open in "SoundCloud" option as well. So how SoundCloud registered a http link to be handled automatically in the app. Please help guys
Screenshot of SoundCloud Open
The answer to this problem is using Associated Domains (But after 9.2 we have to use Universal Links to achieve this).
Before Universal Links, the primary mechanism to open up an app when it was installed was by trying to redirect to an app’s URI scheme (registered in the app’s PLIST like so) in Safari. This put the routing logic in Safari, but there was no way to check if the app was installed or not.
iOS 9 Universal Links were intended to fix this. Instead of opening up Safari first when a link is clicked, iOS will check if a Universal Link has been registered for the domain associated with the link, then check if the corresponding app is installed. If the app is currently installed, it will be opened. If it’s not, Safari will open and the http(s) link will load.
Functionally, it allows you have a single link that will either open your app or open your mobile site.
Configure your app to register approved domains
Registered your app at developers.apple.com
Enable ‘Associated Domains’ on your app identifier
Enable ‘Associated Domain’ on in your Xcode project
Add the proper domain entitlement
Make sure the entitlements file is included at build
Configure your website to host the ‘apple-app-site-association’ file
Buy a domain name or pick from your existing
Acquire SSL certification for the domain name
Create structured ‘apple-app-site-association’ JSON file
Sign the JSON file with the SSL certification
Configure the file server
Apple launched Universal Links in iOS 9.0, which moves the app routing into the OS so that developers don’t need to worry about doing the routing in Javascript.
Receiving Universal Link URL in the App
URI schemes received the deep link URL through openUrl in the App Delegate. Universal Links receive their data via a different code path: continueUserActivity. This new delegate method is used for a number of app transitions, ranging from Spotlight to Universal Links, and will likely see a couple more use cases introduced in future OS versions.
Below is a snippet of code that you can use to retrieve the full Universal Link URL that opened the app.
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *))restorationHandler {
if ([userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb]) {
NSString *myUrl = [userActivity.webpageURL absoluteString];
// parse URL string or access query params
}
return YES;
}
Source: https://blog.branch.io/how-to-setup-universal-links-to-deep-link-on-apple-ios-9
If you want to check if your user has Gmail (so you can switch to Gmail to send an email) you can see if they can open "googlegmail:///co?to="
Is there something equivalent for Google's new app, Google Inbox?
I tried "googleinbox:///" but it didn't work.
Is there a place where you can find these links?
Tried: http://handleopenurl.com/, but doesn't even have Gmail (EDIT now this site is dead.)
Thanks
The Info.plist in the Inbox app lists 4 URL Schemes it will respond to:
inbox-gmail
inbox-gmail-x-callback
com.google.sso.296495646338-v31uuqp2kboh7qfi8jh5oga1lk1lb5sj
com.google.sso.294296358152-6s4pqed0qa6sk3m3k2pcmsu2jidh8n5u
The last two are most likely for single sign on callbacks, and the second is probably used for returning to Inbox after Inbox itself does an [UIAppliaction openURL:] to another Google app (e.g. Google Maps). I've tested "inbox-gmail" and it does open the Inbox app.
To open Inbox and compose an email you use the same url as gmail, but without the triple forward slash:
googlegmail:///co?to={email}&subject={subject}&body={body}
inbox-gmail://co?to={email}&subject={subject}&body={body}
Here's how you can access Info.plist for Inbox or any other app on the App store
Download the app in iTunes on your Mac
Go to the "My Apps" tab, right click on the app and choose "Show in Finder"
Right click on the app file and "Open with" -> "Archive Utility"
Open the extracted folder. Open "Payload" folder.
Right click on application and choose "Show Package Contents"
You've now got access to the Info.plist for the app and all the other resources: image, sounds, .strings, etc.