when the dynamic link is opened from browser(especially in safari) it is always redirecting to the app store even though app is installed in iOS - iphone

My URL is same as below, i will get this link to my mail from sendgrid and in iOS when i tap on this it always loads the browser first (safari most of the case) and opens in app preview page even though app is installed.
URL:<a clicktracking="off" href="https://{project_name}.page.link/?link=https://{project_name}.page.link/users/email_check/{{ $email_token }}&apn=com.{project_name}.app&isi={applestoreid}&ibi=com.{project_name}.app&efr=1">https://{project_name}.page.link/?link=https://{project_name}.page.link/users/email_check/{{ $email_token }}&apn=com.{project_name}.app&isi={applestoreid}&ibi=com.{project_name}.app&efr=1</a>

When you access a dynamic link in a browser. It will intentionally not go to your app because the actions indicate that your intent is to open a web page.
If you have your custom domain from Firebase ie: [your custom domain].app.goo.gl, send it into your link like so:
https://[your custom code].app.goo.gl/
And then tap that link. Does it open the app, or does it go to Safari? If it goes to Safari, it means that you haven't configured your iOS app for universal links yet, which is needed to support opening your custom domain url directly in the app. In Xcode, go to the Capabilities tab, and ensure that you've added the universal link domain as described in Apple's docs.
If you tapped the site address on the far top-right on iOS, it disables universal linking on that iOS app, until you long-tap and ask to open in the app again.
Second, you can't type in universal links into Safari's address bar and navigate to the app. Safari, by design, will open that URL in the browser. The easiest, most reliable way to test whether universal links are working is to put a universal link into the app, and tap the link from there.

Related

URL to open iphone app if installed, or open itunes if not installed?

I'd like to post a URL on my site which, when clicked, either opens up my iphone app (if it's been installed on the phone), or, if the app hasn't been installed, opens up itunes with my application, to allow it to be installed.
This seems like a basic sort of thing that might be quickly done with a magic formula URL, but I can't seem to find the relevant documentation anywhere.
This is exactly what Smart App Banners in iOS 6 are for:
http://developer.apple.com/library/ios/#documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html
"If the app is already installed on a user's device, the banner intelligently changes its action, and tapping the banner will simply open the app. If the user doesn’t have your app on his device, tapping on the banner will take him to the app’s entry in the App Store."

How to make ios App Store link with parameters?

The new "smart app banners" have a method where you can pass parameters to yor app so that it can know, for examples what page on your site the user was on before they bought your app. This is useful, for example, with a news site where you ant to show them the article you were previously displaying.
The way to do this with he smart app banners is:
<meta name="apple-itunes-app" content="app-id=311507490, app-argument=http://bookID/1234"/>
Is there a way to make a general link that does this, instead of a smart app banner?
The advantage of smart app banners is that the iOS detects if the app is installed or not. If it is installed on the device the banner opens the app directly. Otherwise it takes you to the app store.
A disadvantage is that they only show up in mobile safari and they require iOS 6.
As an alternative you could use custom URL schemes. The application has to implement this scheme. The URL would look like this: myapp://bookID/1234.
You can also check if this link works (app is installed) using javascript.

How does Facebook handle tablets?

I'm developing a Facebook app that has a responsive layout. Sometimes my app has to generate a link for the user. Whenever possible, the links will send the user to a Page Tab (when the user is on a desktop) and other times it will link directly to the app (when the user is on a mobile phone).
What is the default behavior for Facebook on tablets? Does it show the mobile site or the desktop site?
Should I use the mobile or desktop version of my app on tablets?
Update: In response to BBog's question in the comments:
My app prefers the desktop version because it includes a Like-gate. If the user experience is good for a tablet to view the app in a page tab (which is only available on www.facebook.com ie non-mobile), then that is preferred because the like button will be displayed at the top of the page, above the app's iframe. In contrast, the mobile version of the app requires that the user click a link that takes them to the (mobile) facebook page which they must like to un-gate the app. It adds an extra step for the user and requires that they navigate away from the app for a moment. Users might be discouraged by this extra step and decide not to enter the gate.
For Android tablets - Honestly, it depends on how you want Facebook to handle it. If you look at the android native app linking wiki - https://developers.facebook.com/docs/mobile/android/deep_linking/, Facebook provides you the option to choose the user experience. The facebook native android app itself treats tablets like mobile phones. It would be ideal if your app is compatible with tablets, and then you can enable deep-linking which will let the user view the content inside of your app.
For iOS, it's handled from within the iOS bundle id.
Unable to find a concrete answer, I ended up detected the user's referral on the first page access. Then if www.facebook.com is in the url, I go to desktop. Otherwise I go to mobile..
if ($detect->isTablet()) {
session_start();
if (!isset($_SESSION["tabletAsMobile"]))
$_SESSION["tabletAsMobile"] = (stripos($_SERVER["HTTP_REFERER"], 'www.facebook.com')===true):'0':'1';
}
$useMobileLinks = ($detect->isMobile() || ($detect->isTablet() && $_SESSION["tabletAsMobile"]));
}

Open an app when clicking on a url iOS

I'm wondering if there is a way to open an app when clicking on a link in safari (or other browser) in iOS.
My app posts the name of a location, a screenshot on Twitter/Facebook which also has a link. I need to detect when the user clicks that link if he is on a pc or iOS device. If they're not on iOS device I want to continue to the linked page otherwise I want to open the app and also take take that location name as a parameter when opening it.
If the app has registered a custom URL scheme the device will open the particular app when it's asked to open a URL of a particular scheme.
This stems from the CFBundleURLSchemes key of your apps infoPlist. Apple's documentation has all the information you need to get started.
To register a URL type for your app, include the CFBundleURLTypes key
in your app’s Info.plist file. The CFBundleURLTypes key contains an
array of dictionaries, each of which defines a URL scheme the app
supports. Table 6-2 describes the keys and values to include in each
dictionary.
See more here at the iOS Programming Guide: Advanced App Tricks under 'Communicating with Other Apps' section.
Edit
In order to support the specific functionality of your question you need to go one step deeper.
Your first link needs to be a standard web URL.
The page presented from the first URL needs to detect the device and forward the user onto a second URL that will open the app on the device, with whatever parameters you want to forward to the app.
So - what you're going to have to do is build some sort of device detection into the page that your first URL points to. On that page, detect the device, then conditionally forward the user onto the second URL that will be the custom URL of your particular app.
It's possible to do this device detection, and detect if they have the app installed on their device with some of the newer HTML5 features supported by mobile browsers, but your question is themed around opening apps with URLs in iOS and the main native iOS hooks you need to support opening apps (with parameters and all) is in the documentation above.

Return to app from safari

In my application, I redirect the user to the safari browser when he/she taps on a button, which in turn closes the application and opens the safari browser. There is no problem in that. It works fine. The thing is when the user quits the safari browser, I want to redirect the user back to the application, not the home screen. Any idea please...
If you control the website that you are redirecting them to, then you can place a link on the site using custom URL which I describe in more details below. But if it's a site you don't control, you can have the user surf within your app using the UIWebView.
For an iOS app, you can create custom URL schemes that your app register with the system. Then on the web page you would create a link using that custom URL. That is how Apple launches the telephone.app or the mail.app from mobile safari.
For example: Let say your app is call BigBadApp. You custom URL would be: bigbadapp:// Now, you could create a link to your app would be: Launch BigBadApp You can pass any kind of information back to your app using the custom URL and your app will handle that information in the app delegate. For iOS 4.2 and later: application:openURL:sourceApplication:annotation:. The name of old delegate on earlier version of iOS is application:handleOpenURL:
For more information see check Apple Implementing Custom URL Schemes.
Also iOS developer:tips has a tutorial on Launching Your Own Application via a Custom URL Scheme.
You can't. When you redirect someone out of your application the only way to get back is using the task switcher or opening your application from the home screen again.
If you want to keep the user in your application you could open the web pages in a webview within your application
use UIwebViewController . that represent web link within app . so that your app wont be in back ground and add back button in navigation bar on click back button navigate to back screen . i guess it would be better
i would launch an in app browser...
this is a good uiviewcontroller subclass that has most of the browser functions already implemented. its very easy to use.
https://github.com/samvermette/SVWebViewController