iOS how can open app from url or redirect to app store to download the app - ios

I'm tryin to implement sending email or message with url to be open in the app but in case the user doesn't have the app install the url should redirect to download the app in the app store. For example:
1.- user1 sends email to his family with the url to load information in the app
2.- the family doesn't have the app install on there iOS devices and when they click on the url loads the itunes store to download the app. When they download the app the click the url again and the information is load it.
any of you knows how can implement something like this?
I'll really appreciate your help

The email should contain a link to a webpage for the content if possible. Then, that webpage should be designed so content can be opened in the app (see this question).
Since it is difficult to detect if the app is installed from a webpage, the webpage can have a link to install the app if it is not installed.

You are going to have to launch the app using the already suggested method:
window.location = "myapp://myparam";
Then you are going to need to check if that page launches or not (whether your app starts up or not). If it does not then you can launch a search in the app store by this means:
window.location = "itms-apps://ax.search.itunes.apple.com/WebObjects/MZSearch.woa/wa/search?media=software&term=(your company/app name)"
Instead of doing this search you could also just provide the link directly in the app store to your app. I see the hardest part being checking whether or not your app launches from the original attempt to launch your app through window.href, I don't know how to accomplish that check.

Related

Adjust deeplink redirects to Appstore all the time when opened from Instagram

We have enabled Adjust universal deeplinks for our apps. We have done all the setup required for deeplink to work. Also our Adjust deeplink works fine when we open it from apps like 'Slack' or 'Notes'. But when we try to open same deeplink from Instagram, user is redirected to App store every time even when app is already installed.
I have got an article regarding Deeplinking on iOS from Instagram and I read there that it will not work until it's paid add. Does anyone have any clear idea about it?
Instagram requires deeplink / universal link to have a path appended to it, or the user will be taken to the store even if the app is installed.
E.g. this link will take user to the store:
https://app.adjust.com/x00abc1?deeplink=adjust%3A%2F%2F
however this one will open the app (if installed)
https://app.adjust.com/x00abc1?deeplink=adjust%3A%2F%2Fyour_path
Interestingly, this path does not have to be valid, there just needs to be a path. I.e. if the client / partner only wants the deeplink to open the app, they can add any invalid path. This will lead to the deeplink opening the app, but being served a path it does not recognise, which leads to the app simply not opening said path, but the app will be open.
Note: Some special characters, like ? are not technically a path, and will therefore not provide the desired behaviour.

Send user to iOS9 app store to update

I would like to send a user to the iOS app store update page so they can update my app when prompted, so I can require that users update the app if the update contains critical security fixes, or something else vital.
I believe that I have found a link that I can send the user to the update page, which is
itms-apps://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftwareUpdate?id=<appid>&mt=8
So in my case I would use
UIApplication.sharedApplication().openURL(
NSURL(
string: "itms-apps://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftwareUpdate?id=969701501&mt=8"
)!
)
But I am not able to test it, because I am given a 404 page in the app store when I try
I'm assuming that I get this because the app was not actually downloaded from the app store (it was put onto my test device from Xcode), and I'm unable to test the link because I would need to download the application from the app store if my assumption is correct.
I've looked into using an itunes.apple.com link, but that redirects
to the app page, and although that page does have an update button, phobos.apple.com seems to be better because it only contains information about the update, and the new features in it, making it more user friendly.
Is my link correct for iOS 9, or is there a different/better method to send the user to the app store's Update App page? Even better, is there any way to prompt the user to update the app via an alert (kind of like requesting access to camera roll or location services, but updating the application)
Instead of this, you can open your application via the URL provided by Apple. This will automatically re-direct to your application page on App Store.
For example, https://itunes.apple.com/in/app/ibooks/id364709193?mt=8

Putting information into a newly installed app

I have to create an iOS app, which needs to know a referral code right after the installation. The code comes from an email or from a link in the browser. The goal is to make the app have the referral code no matter it is already installed on the user's device or it is being installed by the clicking of the link.
What I know already:
I have to register an URL scheme with my app, for example myapp://
I have to handle opening by this URL, recognizing the referrer code from it (myapp://refcode=123)
I have to have a web service, which detects (with JavaScript) if the user's device can handle my URL scheme or not (like this: https://stackoverflow.com/a/6599773/511878)
If the app is not installed, I can send the user to the App Store to download it, otherwise I can open the app by this URL and transfer the information into it
What I miss: How can I immediately call this URL after installation?
I was sure this is impossible to do until this morning, when I've found that Apple's TestFlight is doing exactly the same. I've got an email containing an invite to some app, clicked on the link, and because I did not have TestFlight installed on that device so far, it brought me to the App Store, where I clicked install. The device installed TestFlight app. After this I've clicked the Open button in the Store, which immediately showed the invite for me.
I think the solution can't be that it recognized me, and picket up the invite from the server based on my user account, because I might have multiple invites, so it had to know which exact one to show.
EDIT: Video of this happening: http://gk.lka.hu/x/tf.mov
So the question is: How can I transfer information into an app which is being installed after a link is clicked without reclicking the link?
I'm a developer at Branch and we recently built this system for others to use. If you want to build a similar system from scratch, here is an example of what you'll have to do:
The web service you described above must capture some information from the user, such as IP address, OS, OS version, screen size, etc., before redirecting to the App Store. It should associate this with the link that was clicked, or at least the refcode from the link (http://yoursite.com/redirect?refcode=123).
After your app is downloaded, the first time it opens, send up the same info (IP Address, OS, etc.) up to your server. If your server sees these params and that they're the same as what you grabbed in step 1, it should pass back refcode=123 to your app.
Your app should then handle the 123 refcode however you see fit (e.g. open to the appropriate view controller, apply the referral code, etc.).
Hopefully that helps. It's definitely harder than it sounds to build from scratch..

Detect app url download location after iOS app install

I have a requirement where i publish the iTunes app link to download the app in the website.
say i have 3 websites A, B, C
After the app is downloaded from the link, based on the website from where it has redirected i need to show custom message or image .
Say if the user click on download app on website A, then after the app is opened it should show "you have downloaded from website A"
No you can't, simply because the user downloads the app from the App Store and not from the website.
I do not have much experience with website development but I think you can set something on website where if you click on AppStore link it triggers an event to database and stores website name and whenever App is opened for the first time you call a web-service that interacts with your database and tells you the website name. But I do not think Apple will be happy seeing something like that in an App.

iOS app pass specific id when app install from link

Project Detail :-
I am developing simple application in iOS,When app start there is one specific id or you can say password for specific user for login.
E.G.
I am installing app from link and link contain 12345 password,so when app installed from link and open app first time that password use as login. when other link contain abcde as password and install from link and open app first time that abcde password used without entering that from user.
Is there any way to pass specific id in url when app install first time from link.
As Per Apple Documentation about Promoting Apps with Smart App Banners
Is there any possibility to pass custom/specific parameter when user install from Smart App Banner and get that custom/specific parameter when app launch first time?.
I have read in forum and didn't get full information that it is possible or not?.
Not both install and open with information at the same time.
You have on link to go to the app store to get the app. You have another completely separate link to open the app once it is installed and pass it some information. From a user point of view these are 2 distinct tasks.
In the page you link to, app-id=myAppStoreID supports getting the app from the store and app-argument=myURL supports opening the existing app with supplied information. But, the user would click the banner once to go to the store and get the app, then return to Safari and click the banner again to open the app.

Resources