I am building an application for use by my company that has a number of features. One thing I am interested in adding if at all possible is linking a specific format of internal ID to my application if it exists in an email, much the same way that UPS/USPS/FEDEX tracking numbers are converted into links in the email app.
Is it possible to build an app extension that would create a link from an ID that is in an email, and launch my application when it is clicked?
For example, if the following ID (1453833784.127410) is in the body or the subject of an email message, the end user could click it and have it launch the app.
My experience in app extensions is limited so any assistance would be appreciated.
Thank you
No, this is not possible. There is no API that can hook into the Mail app (or any other app) such that text in a certain format gets translated into a URL for a 3rd party app.
If you have any control of the email generation, the creation of the original email should be updated to include the link.
You can use custom url schemes for example:
When user click the link yourapp://1453833784.127410 in the email if the app install it will open the app to handle the url via application:openURL:options: in app delegate
You can define custom url schemes in your app's Info.plist
URL types <Array>
Item 0 <Dictionary>
URL identifier <String> com.example.yourapp
URL Schemes <String> yourapp
This custom url schemes solution should work on Android app too.
Related
How can I add deeplink (url like https://www.example.com) in iOS using swift.
The scheme in plist is not working if I enter url in it.
You can check the screenshot of plist attached.
You are attempting to register your app for the URI scheme https which Apple has already reserved for Safari, therefore you will not be able to use it.
Option 1: Custom URI Scheme
You must come up with a custom URI scheme like customURI://www.domain.com
Downside: If a user clicks on this link without the app installed. iOS will show that user and error.
Option 2:Universal Links
Apple launched Universal Links in iOS 9 to enable developers to associate their http link with their app. This requires you to host your own AASA file on your domain so that your domain becomes associated with your app ID.
Option 3: Branch.io
Branch will actually bundle up Universal Links and URI schemes and use them appropriately when necessary. They also perform deferred deep linking. They'll host your AASA file for you, but your app domain will have to be either https://*.app.link or some dedicated subdomain of a domain that you own.
only to be precise:
If you need more docs about in Apple docs, use the CORRECT name for the technology.
If You use url starting with a schema different from http (for example fb:// for FB) is not a LINK, is a "custom" url.
Anyway use: custom url and see at:
https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html
How to Open an iOS App using Firebase Dynamic Links and Pass or get Parameters To an App Via Custom URL Scheme in iOS(swift)?
for eg :- https://q3tyj.app.goo.gl/abcd
My URL Scheme is ‘q3tyj.app.goo.gl’ in iOS app in Url Types.
If I type q3tyj.app.goo.gl in safari, I am able to open the application. But if I type q3tyj.app.goo.gl with some extra parameter like https://q3tyj.app.goo.gl/abcd in safari, , I am not able to open the application.
please also explain me how to get “link” parameter (which associated with dynamic link) from dynamic link in iOS app ( Swift ) .
I followed steps which were mentioned in Firebase.google.com for iOS ( Swift ).but its not working.
Thanks,
Nirav Virpara
It's hard to know exactly where your error is, but a few things to help you debug:
If you go to https://q3tyj.app.goo.gl/apple-app-site-association, you should see some JSON that points to your app. If you don't see this, make sure you've entered your team ID and your App Store ID in the project settings in the Firebase console
Make sure you're using your Bundle ID, not the shortlink domain, as your custom URL scheme in Xcode
Make sure you've enabled Associated Domains in the Capabilities tab of your Xcode project, and your domain looks like applinks:q3tyj.app.goo.gl
Universal Links (and, therefore, Dynamic Links) generally don't work if you type them directly into the Safari address bar. Instead, try typing the URL into an app like Notes and then clicking on them from there.
Good luck!
If you type https://q3tyj.app.goo.gl/apple-app-site-association this link in your browser and check, you will end up seeing a json, meaning your apple-app-site-association is correctly configured on your google website. However, you need to make sure that teamid in your google console or appid is correct.
I successfully have a message url from the gmail api:
https://mail.google.com/mail/?authuser=roy#companyemail.co#all/155134b5e66a9b06
However, when i call the [[UIApplication sharedApplication] openURL:url] method, the web client gets opened up instead of the native iOS application (and just shows the inbox, not the specific message). Not sure if it has to do with the LSApplicationQueriesSchemes or not, but regardless - couldn't find any documentation on this in the Gmail iOS documentation, so if anyone has any ideas!
Thanks
Through the links the Brett posted, this deep link url allowed me to open gmail:
googlegmail://
Still searching for instructions on deep linking to a specific email though
It seems that the openURL method is designed to do what you want to do. But any URL which starts with http: or https: is going to open in Safari. Here is a quote from the doco.
A URL (Universal Resource Locator). UIKit supports many common
schemes, including the http, https, tel, facetime, and mailto schemes.
You can also employ custom URL schemes associated with apps installed
on the device.
I presume that if you wanted to compose a message in the built-in Mail app, you would use a mailto: URL. Not sure about opening an existing message. And if you want to open an existing message in another app, then that app would need to define a custom URL scheme, and you'd need to use that.
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
I am trying to write an app that does a person search of my company. When it returns a result, I want to include a feature to add the person to the Contacts app with the push of a button.
The problem is, I can't find a way to launch the Contacts app through a custom URL scheme with the new person info as parameters. Does anyone have any idea if this is possible and if so, how to go about that?
If there were a public URL scheme, Apple would have documented it in the URL Scheme Reference.
Your options are:
ABNewPersonViewController or ABUnknownPersonViewController
Direct modification of the address book. (archived link)
There is a URL scheme for the Contacts app on the Mac – the addressbook scheme. You might want to try whether this works on iOS as well.
No,Not possible to open Default contact application as URL scheme is not available