custom URL Scheme in iOS 6 not working? - ios

My app uses a custom URL scheme so i send a link to my users in an email which when clicked, launches my app installed on their devices. This was working seamlessly till iOS 6 came into picture.
Now when the users click on the link or even type the address manually in the safari they get an error saying "Safari cannot open the page because it is a local file."
Wondering if anyone else encountered the same or if someone has any pointers in this regard !!
Any help much appreciated...
Update: it works if I only give my app's custom url without any parameters.. e.g. if I do "reader-app://" it launches my app but if i do "reader-app://doc=xyz" it doesn't !

try: reader-app://?doc=xyz (add a question mark after //) this way you'll specify a query string. It works for me, but it presents an alertdialog asking the user if she wants to open the url with my application

Try to remove the - sign from reader-app://.
My URL was not working until I removed underscore sings from URL.
Ex:
my_app:// is not working.
myapp:// is working.
That is just a guess.

Related

Firebase Deeplink not redirecting to app if select goo.gl

I'm integrating firebase in application. I created universal link that worked for Android & iOS both.
This worked great. BUT I got scenario where I clicked on goo.gl (PFA) link which was displaying on launched app right-top side. And from then no matter what I do, Deeplink will never launch my application.
I checked to clear history of device-browser but it's same. Any suggestion how to get rid of this issue/feature ??
You're absolutely right: the forward button is horrible UI/UX. It's one of the big flaws with Universal Links identified in this blog post. There is no way to disable the forward button, and once it's triggered, you're screwed.
The easiest way to re-enable Universal Linking behavior after it is turned off is to long-press on the link. Your best bet at getting a clean shot is to paste the Universal Link URL into the stock Notes app and try long-pressing it from there.
Long hold on the url and there will be option to open in app.
Usually when you click the "forward" link to open the universal link in Safari, you can re-open the app by dragging the page down. A bar will appear with your app name and an "OPEN" button. This works as long as you're still in the same URL.
Unfortunately, for Firebase Dynamic Links specifically, the link will redirect you to another domain (for example, from https://z99zz.app.goo.gl/zzzz to https://z99zz-c.app.goo.gl/zzzz) and this breaks this feature. The solution is to either add ?d=1 to the original link (https://z99zz.app.goo.gl/zzzz?d=1, opens a link debug page), or just remove everything after the domain (https://z99zz.app.goo.gl/, opens an error page). Now when it opens in Safari, you can drag down and see the bar.
In addition to imgx64 post. I had a similar problem: Firebase redirected to z99zz-c.app.goo.gl/zzzz and in this case system was not redirected to my app. I added "applinks:mzn3g-c.app.goo.gl" as Associated domain in my target capabilities and this does the trick! Even if you redirected to domain with "-c" suffix iOS can recognize it and will redirect to your app and show suggestion in Safari

Deep linking in iOS 10 not working

I have an app that relies on deep linking using a custom scheme ://appName for some user email verification. The way it currently works is:
User enters email in app and hits send
Email is sent to user, user taps on "activate" button
Button opens valid website url which then redirects to deep link url, i.e ://appName/auth/tokenId
All was good, and this worked flawlessly on iOS 9 devices, but iOS 10 seemed to break it.
After further investigation:
appName://id=123 opens in iOS9, but in iOS10 safari displays that “the url can’t be shown” for the exact same URL.
They will both work however for the URL scheme alone (appName://)
You can even test this on your devices/simulator to see. Perhaps the change is in safari?
More investigation:
Almost sure its related to Safari.
Any ideas on how to resolve this?
Eventually tracked down this issue and got a response from the CEO of Branch. He said:
Ah interesting find! I just tested a few ways and it seems to reject
typed-in URI schemes with a deep link host & path, but you can still
trigger them in JS and click them on page. You just can't type it in
for some reason.
So beware of this if you are using deep linking in such a way on iOS 10!
I personally ended up just giving the direct deep link URL in the email, rather than embedding a redirect in a nice button. Something like this appName://gotoHere/here

Open iOS App by http:// link

I found a lot of tutorials about opening an app by a custom url scheme like:
myappname://
Thats nice but it would be great to open an app by registering the real app domain over the http link like
http://www.myappdomain.com/blablabla
So - for example - if a visitor comes to a webpage (on her/his mobile) it is normally opened in the browser, excepts the installed app is listening to the opened URL and opens itself instead of the browser.
How is this done (i've seen this at another app). Any help would be great. Thanks in advance!
It is a new feature in iOS9. It is explained in the WWDC15 talk Seamless linking to your App.
You could also add a small piece of javascript to each page that opens your custom URL-scheme.

Link to open up iOS app from facebook and twitter page and other ios app?

Hi I have a requirement in my app. From my ios Application(myapp),i share a link to facebook. Then I opened up my facebook account in browser or Facebook application and clicked the link, link should open in myapp if myapp is installed in the device otherwise link should open in browser. How can I achieve this ? Please suggest me step by step. Thanks in advance for your consideration and help.
I am not sure if this is possible. I have looked at various questions including
Is it possible to register a http+domain-based URL Scheme for iPhone apps, like YouTube and Maps?
as I am sure you might have already done but these questions target their own app, mainly web app, but you want that behavior to occur from an app that is not yours like twitter or facebook. But what you can do is show them two links on facebook/twitter, if they have installed press link 1 and if they want to install, press link 2 and you can pass parameters in link 1 as you might already know.
I will also keep checking answer of this question if some one comes and gives a better solution.
There is an option called custom URL scheme in iOS. It will help you to create a URL scheme which identifies your application. You can post link with this URL scheme and when you tap on this link on your iOS device it will open up your mobile app. Please see the link below to know how to setup this.
Custom URL Scheme in iOS
This is called 'deep URL linking'. Facebook have built a service called 'App Links', which seems pretty cool.
https://developers.facebook.com/docs/ios/app-links

iPhone http:// URL redirection

The main task I'm trying to achieve is to open my app with a URL.
Adding the custom URL scheme to the appName-Info.plist everything works fine using the corresponding handleOpenUrl: etc etc.
My point is that my app has got a webSite as well. So what I'm trying to do is, given an url to my users (tiny, short url doesn't matter) combine together these 3 different cases:
If the user opens the URL from his iPhone and he's got the app installed: open the iPhone app;
If the user opens the URL from his iPhone and he hasn't got the app installed: open the iTunes store URL of the app;
If the user open the the URL from his phone (android, tablet, etc) , or from the web, show the web page instead.
My problem is that I can achieve all these tasks separately but I cannot combine all together.
Note: tried to add the http://myApp.com to the UrlScheme but of course didn't work coz the http:// is managed by Safari in the iPhone.
Any idea? Help and suggestions would be really appreciated. Tks a lot chaps.
This SO question seems to have the answer you're looking for:
Check if the user-agent is that of an iPhone/iPod Touch
Check for an appInstalled cookie
If the cookie exists and is set to true, set window.location to your-uri:// (or do the redirect server side)
If the cookie doesn't exist, open a "Did you know Your Site Name has an iPhone application?" modal with a "Yep, I've already got it", "Nope, but I'd love to try it", and "Leave me alone" button.
The "Yep" button sets the cookie to true and redirects to your-uri://
The "Nope" button redirects to "http://itunes.com/apps/yourappname" which will open the App Store on the device
The "Leave me alone" button sets the cookie to false and closes the modal
The other option I've played with but found a little clunky was to do the following in Javascript:
This would solve one of your problems, it will link the user to the app page:
itms-apps://itunes.com/apps/APPNAME

Resources