App Store link parameters / InstallReferrerReceiver equivalent on iOS - ios

I'm aware that on Android you have the ability to add the parameter referrer to a Play Store URL the parameter will be passed to the app on app launch...
e.g.
http://market.android.com/details?id=your.application.package.name&referrer=my_referrer_finally_works_fine
Is there a similar parameter on iOS? I'm looking to link my users to the app store and launch them into a specific screen once they launch.
Links for InstallReferrerReceiver
https://developers.google.com/android/reference/com/google/android/gms/tagmanager/InstallReferrerReceiver
Get referrer after installing app from Android Market

I went with a mixture of Firebase and universal links in the end
https://firebase.google.com/
https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html

Related

What are all the custom URL schemes supported by the Workplace by Facebook iPhone app?

I am trying to open a group page in Workplace by Facebook app, unfortunately I did not find any custom URL scheme to do it like for the Facebook app.
Does anyone have more information about the custom url schema that can be sent to the Workplace by Facebook app for iPhone?
I recently had the same issue and found out that the main url scheme for Workplace is fbatwork.
To open the app straight to a group, the only working format on iOS seems to be
fbatwork://group?id=your-group-id
There are also a few more available, but I don't know exactly what's their purpose: fbatworksso, fbatworksignup, fbatworkssoreauth, fb-work-emailless

Xcode 7 + canOpenURL, how to have Facebook and Twitter to open my own app links

Before Xcode 7, it was working fine. When I post link like "myapp://mylink?id=1" on Facebook and Twitter for social media sharing, the users can click on it and it will open my own iOS app if it is installed. I know xcode 7 put limit of 50 url schemes that any app can ask "canOpenUrl" before actually proceeding with "openUrl". Apparently Facebook and Twitter both still checking canOpenUrl before opening the link (they open in a UIWebView inside their apps), and since they can't add all the world's apps' custom url schemes into their app plist because of the 50 limit, my app now can't be opened from FB and Twitter with my custom url scheme. Log shows following on the console:
Twitter[827] <Warning>: -canOpenURL: failed for URL: "myapp://mylink?id=1" -
error: "This app is not allowed to query for scheme myapp"
Now the question is, is there any way I can have it working like before, where users can click on some link (myapp://mylink?id=1) on FB and Twitter, then that opens my own app through custom url scheme?
FYI, I actually post link like http://myweb.com/link?id=1 on those sites, and the link is processed on my webserver based on the HTTP header request to decide to redirect to actual web, or if iOS then redirect to myapp://mylink?id=1, and if Android then redirect to another url scheme for android app etc. I tested with just posting myapp://mylink?id=1 link directly on Facebook and Twitter, and it's still not working giving same error.
Add on:
The iOS9 new rules is that you need to add following, up to 50 of them, to your app plist so that your app can query the OS for canOpenURL, but it also renders unusable for big apps like FB & Twitter:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>myapp-custom-url-scheme</string>
</array>
To me from my reading around researching this issue, the solution is:
either Apple should change this restriction to more rate limit based, so that abusing apps (like Amazon something) wouldn't use it to scan for all known url schemes to build statistics of app installs,
or Facebook and Twitter etc big social media sites should stop checking canOpenURL, and just go ahead and openURL without verifying.
or even better, we should build some centralized database for custom URL scheme name spaces, and both iOS and the other apps should use it for this kind of general purposes.
OK, Facebook and Twitter recently released updates that have fixed this issue now.
Seems like they are not checking canOpenURL anymore, and letting any app's custom url scheme to open, unless they are doing some other ways to validate it.

Web service for deep linking

This is my first time create an ios application that required deep linking. I need to create a web service for my custom url scheme for ios in order to publish it online. Please give some pointer on regarding which web service i should use or is there an alternative way to create a deep linking for custom url scheme for iOS. Thanks.
You can do it yourself with any server platform - Rails, PHP, Dot.Net, etc.
Here is a very simple PHP snippet. Replace "myappname" with your app's URL scheme. The param/value query is optional - you can use any other text and parse it in your App Delegate's openUrl method.
if (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone OS') !== FALSE) {
// redirect
header("location: myappname://?key=value");
exit();
}
Client use-cases:
iOS Safari, your app installed - will open your app.
iOS Safari, your app not installed - Safari will complain that it cannot open the link.
Another iOS app, your app installed - will switch to your app.
Another iOS app, your app not installed - same as Safari. However, if the other app is implementing UIApplication's canOpenURL: - it may gracefully take the user to the App Store, but it's up to the other app developer.
Any other device or browser - will continue to render the page, where you can add your html including AppStore links.
If you don't want to create the server code, you can use a tool I created for this purpose. You have it here:
http://www.uppurl.com/
It's mainly a short link tool that checks for user device and give him the right url based on his devices. With this tool you don't need to write any server code and it also takes care of different devices, operating systems and browsers.
Take care of Tal answer as latest versions of Chrome has changed the way to open app and now you need to provide a link in different format, they use something like "intent://..."

Create iOS link to an App in the app store - best way?

Here are my requirements:
1. Create links to a single app in the app store 2. Access the links either from inside an app, on the device generally (e.g. mail link) or from a PC (e.g. via facebook share link) 3. Open links using iPhone or iPad running iOS 5+
I have done some digging around and come up with the following options:
http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=487547243
http://itunes.apple.com/gb/app/anyValue/id487547243?mt=8
http://itunes.com/apps/seligmanVenturesLtd/mouseTrapFree
http://itunes.com/apps/mouseTrapFree
itms://itunes.com/apps/mouseTrapFree
itms-apps://itunes.com/apps/mouseTrapFree
Just wondering if one (or some) of these are better than other?
Thanks.
Ok, so have done a lot of research/testing and here is my conclusion:
Links you use in your code should not rely on the 'current' name of you app, since this might change over time (e.g. Light Alarm Lite vs Light Alarm Free). Therefore the following 4 are out IMHO:
http://itunes.com/apps/seligmanVenturesLtd/mouseTrapFree
http://itunes.com/apps/mouseTrapFree
itms://itunes.com/apps/mouseTrapFree
itms-apps://itunes.com/apps/mouseTrapFree
That leaves itunes and phobos URLs. I have just tested both URLs via the iOS 6 share functionality (so this might be different on iOS 5, but given numbers are reducing daily for that I dont really mind). I tested accessing via SMS, Email, Facebook, Twitter (on an iPhone 5 and using a Mac).
Both url types produced near identical results, except for the following:
Phobos:
e.g. http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=346542660
+ None
- Sharing this link on facebook created a facebook link without any image... this was the showstopper for me that will mean I use iTunes urls going forward (see below).
iTunes
e.g. http://itunes.apple.com/gb/app/appName/id346542660?mt=8
+ When opening link on iphone 'Mail' app the app store opened within the 'Mail' app and no tabs along the bottom appeared, so arguably this creates increased focus on your app
- None
In summary, I will be going with itunes type urls going forward. eg:
e.g. http://itunes.apple.com/gb/app/appName/id346542660?mt=8
(Note: you don't have to stipulate the '/appName' in this url, just keeping it as '/appName/' works fine, which means you dont have to worry if you app name changes over time.
Cheers, Charlie
URL/Link to an app on the app store can be created very easily but there are several ways to achieve the end result. First of all we need to be clear on the purpose of the link (For ex. link might be used for Facebook posts or used inside an app for urging users to rate the app through in-app alerts/buttons). We can broadly categorize how we will use the link in 3 categories:
1. We want to use the link publicly outside the iOS (or OS X) domain. Means you can use this link to share on your Facebook wall or you want to embed the link in mail. I said outside iOS domain because your friends who doesn't have iPhone (or any other iOS device) or MacBook they might also use click that link from Facebook or their mail app/client.
2. We want to use the link inside iOS (or OS X) domain. Means when we are certain that our link will be clicked by device using iOS or OS X.
3. We want to send the app user (already a user of our app) to specific section (like review section) of the app on app store.
For category 1 and 2 it's best to use this type of URL:
https://itunes.apple.com/app/dots-a-game-about-connecting/id632285588?mt=8
When you embed this link then it can result in several outcomes:
If user clicks on this link from iPhone (from any iPhone app or mail app on iPhone): Your app page on App Store will open directly
If user clicks on this link from any Android Phone or Browser (Chrome/Safari/etc.): Your app page on itunes.apple.com website will open inside default browser. Even if you are opening it on you MacBook it won't open iTunes App Store but will display you app page in Browser itself.
Side Note: There are several places on web where below mentioned sort of link is also suggested:
http://appstore.com/dotsagameaboutconnecting
When you embed this link then it can result in several outcomes:
If user clicks on this link from iPhone or MacBook: Your app page on App Store will open directly. So this link is a bit better for MacBook users as it send users of MacBook directly to iTunes instead of staying within Safari browser.
If user clicks on this link from any Android Phone or Browser (Chrome/Safari/etc.): If user is clicking from PC that has iTunes installed then this link will open your app on iTunes else (on Android devices and PC that doesn't have iTunes) it will open a Apple.com page displaying "Download iTunes" without any mention of your app. Screenshot of that page below:
So If you are not sure about who will click on your link (outside/inside iOS domain) or If you want to be on safer side then I recommend first approach. Read here on how to create specific link for your app.
For category 3 simply use below code in some function/action:
NSString *myAppID = #"632285588";
NSString *url = [NSString stringWithFormat: #"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%#", myAppID];
//iOS7 doesn't approve above format so add iOS7 specific format
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
url = [NSString stringWithFormat: #"itms-apps://itunes.apple.com/app/id%#", myAppID];
}
[[UIApplication sharedApplication] openURL: [NSURL URLWithString: url]];
For details on above code see this answer.
For developers who are developing first version of app and app is still not published on app store there is always a quandary about how to get the right link for your to be published app. For that:
Get your app ID from iTunesConnect. Use iTunesConnect to create your new app - give it a name, description, icon, screenshots, etc. Once app is created on iTunesConnect (without even submitting the app), you can get the Apple ID from the Identifiers section for the app.
You should not have any problems with the following one:
http://itunes.apple.com/gb/app/notebookpro/id<APP_ID>?mt=8
I believe, it will be opened on all major browsers/OS.
https://itunes.apple.com/app/id##app-id##?mt=8
Replace ##app-id## with real app-id.
For example:
https://itunes.apple.com/app/id346542660?mt=8
Summary
No country code. Ex: gb
No appName, only app-id.
https protocol.
I'm using the itms-apps: approach in our app, which also allows you to select to which "section" of your app the user will land.
So if you want to show them the reviews, this is what I use: itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=XXXXXXX
and for updating to the latest version of our app: itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftwareUpdate?id=XXXXXXX&mt=8

Possible to launch Apple's default weather app from my application?

One of my client wants to open Apple's native weather app from our application. After few I don't see a possible way, unless we need to go with any 3rd party apps which provides custom url scheme.
http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007899
It would be great if someone confirm or give me a lead if it is possible.
Its not possible, the weather app doesn't have a known URL scheme and I dubt that it has an unknown one.
The website handleOpenURL is an excellent resource for custom iOS URL schemes; use this link to search for the known Apple app schemes.
Unfortunately the weather app is not among them.
Another couple of sites with schemes (handleOpenURL seems to be the most complete, but it can't hurt to check the others):
app lookup
Akosma iPhone URL Scheme Wiki
You can open the weather app with this URL: weather://
Here is a codepen demo I got to work: https://codepen.io/irom1/pen/KKeZBMW
Open weather
I found another site for sharing the url scheme - http://schemes.zwapp.com/

Resources