My project is in SWIFT
User receives an email with Change Password link and the link is going to be like this http://foobar.com/something/reset_token=barfoo
When user taps on link 'Change Password' it should take him to my iOS app to that particular view controller. I know deeplinking but my URL is going to be like this http://foobar.com/something/reset_token=barfoo and not deeplink://
Please help
If you are targeting iOS9 and newer, you can use Universal links
It allows you to redirect the user to your app from an URL (classic http/s), but he can stay in Safari if he really wants to.
You can found the result in action and a good article about your specific case here:
https://blog.curtisherbert.com/ios-9-universal-links-and-forgotten-passwords/
Related
I'm currently working on an iOS app, Swift 4, that automatically launches on click of a link to block users from accidentally navigating to that link.
How would I set this up?
For example, YouTube opens up youtube.com links.
Sorry if this is a vague question, if more info is required feel free to ask ^^
If you create a custom URL protocol like myapp://somepath (where myapp is the protocol) then you just register that custom protocol, and when the user clicks such a link it’ll automatically open your app. You can’t intercept a general purpose URL protocol like HTTP or YouTube.
(At least not without OS support. That's how YouTube and the app store are able to open HTTP links.)
I haven't done anything like this so far but it seems like you should take a look at Apple URL Scheme and Universal Links:
https://developer.apple.com/library/content/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html
https://coderwall.com/p/mtjaeq/ios-custom-url-scheme
https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html
https://www.raywenderlich.com/128948/universal-links-make-connection?utm_source=raywenderlich.com%20Weekly&utm_campaign=95f29cf4fc-raywenderlich_com_Weekly5_31_2016&utm_medium=email&utm_term=0_83b6edc87f-95f29cf4fc-415182745
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
When trying to use Call To Action button into facebook to add "Use Application" button on my page, it asks for my ios app link but I don't know what to fill there. I've tried many things without success :
myAppName://
myBundleId://
myStoreId://
Do you know how to build that app link please ?
Thanks in advance.
The Facebook documentation on App Links should help you with your problem:
https://developers.facebook.com/docs/applinks
Basically you need to setup a URL that has <meta> HTML content which Facebook uses to identify your app and deep link to it. You will need to configure for deep linking in your app too.
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
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