Facebook redirection issue in iOS 9 - ios

Before iOS9, a Facebook post could successfully redirect an user to an installed app via short URL (like bet365://). Now, in iOS 9, bet365:// gives invalid link. From Safari it redirects fine, but not from Facebook browser. This is just an example, there are other apps that can't be opened from FB.
What do I need to do in order to open an installed iOS app from a Facebook post (in iOS9)?
PS: I understood that now, in iOS9, if Myapp1 wants to open Myapp2, it will need to populate info.plist with LSApplicationQueriesSchemes like this:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>url_to_Myapp2</string>
</array>
but it's strage to belive that Facebook will have to do the same with the apps he wants to open.
Many thanks!

There are some changes you need to make in your plist and add a few urls to whitelist Facebook urls. Try adding all of them. It should work then.
Facebook iOS 9 integration

There are various ways you could go about achieving the same:
1. Use a platform like Branch or DeepLink.me
Use links generated by these platforms which will be opened in Safari and then redirected to your app.
2. Facebook App Links
This is the deeplinking solution provided by Facebook itself. Instead of generating static app url scheme links, you should generate applinks for sharing in Facebook. These can then redirect to your app or even the app store page if the app is not installed.
3. Support Universal Links in iOS 9
You can have iOS recognize universal links for your application. These will be in the form of http://yourWebsite/path/to/content and will result in your app being opened directly.
From the documentation:
Universal links let iOS 9 users open your app when they tap links to
your website within WKWebView and UIWebView views and Safari pages, in
addition to links that result in a call to openURL:, such as those
that occur in Mail, Messages, and other apps.
Have a look here on how to configure the same.
I would suggest configuring all of the above for your application, as it will provide various ways for you to direct users directly to your app, each suitable for certain situations.

Related

iOS universal linking for in-app browsers

I have an iOS app with a custom universal link working (Registered in capabilities, correct apple-app-site-association file). It works great from most apps, but for in-app browsers it does not. For instance, when sending the link over instagram, the fallback website opens instead of the app.
When using firebase deep links however, it seems to be working through a redirect or similar. How do I get the same behaviour?

Universal link doesn't open the app on iOS

I have an app with MagicLink authentication implemented using universal links. The app and the server are configured to handle universal links following Apple’s documentation (https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html).
The link successfully launches the app from Apple Mail + Safari. However when I try to open it from GoogleMail + Chrome, it redirect to the AppStore.
It is important to notice that the app isn’t on the AppStore yet and I’m trying to sort out the issue before publishing it.
I can reproduce the issue on the iPhone 6s with iOS 10
This is a known issue with a number of apps. Universal Links do not work in many situations, with the Gmail app being one of them. See a more detailed list here.
To work around this limitation, your Universal Link URL needs to lead to a page with a button/link on it the user can activate. At Branch.io, we offer a Deepviews feature for this purpose. You'll need to build something similar.

Opening Instagram app from a link on iOS

I am providing a feed which is consumed by both desktop and mobile apps which contains links to images, users, and tags on Instagram. When these links are clicked on iOS, I want them to open in the Instagram app.
Currently if I have a link like this:
https://www.instagram.com/p/BK8f1rigadE/
If I click it in iOS, the Instagram app does open, just briefly. It then seems to launch Safari to the page, which includes an "open in app" link to open it back up in the app. That link uses the "instagram://" protocol to trigger the app to open. I'm aware of that method, but that's not what I'm after.
I'm on iOS 10 with the latest Instagram app. I feel like this used to work, so I'm wondering if it's just a bug in iOS or Instagram that will be fixed eventually.
Links to twitter.com open properly in the Twitter app... that's the kind of behavior I'm after.
I found a service called URL Genius (via this blog post) that solves this exact problem, and provides click metrics, too.
I don't like relying on an external service for such an important link, but it's easy, works well, and the basic service is free. I will probably set a reminder for myself to check that this still works every month or so...
Links like this work to open the app:
instagram://media?id=1346423547953773636_401375631
However I want a regular http link, which opens a browser on desktop, and the app on mobile. Not sure if it exists.
From my knowledge, the only supported links into Instagram are described here
I'm not sure what the link you're attempting to use represents: /p/id_here seems like a post? You likely need to use:
https://www.instagram.com/media?id=id_here
The documentation I linked shows the "deeplink" approach (instagram://) which I understand you're avoiding, but the same paths should work through the Universal Link approach, at least from my experience.
Had the same problem. For me was solved by simply uninstalling and reinstalling the problematic app.
(Instagram 171.0 - iOS 14.3 - iPhone 11 Pro)
On iOS you must first add the instagram url scheme in the LSApplicationQueriesSchemes key of the info.plist file:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>instagram</string>
</array>
then you can open the url of the post using the link:
instagram://media?id=POST_MEDIA_ID
POST_MEDIA_ID can be found by looking at the page source, you will find a tag like this:
<meta property="al:ios:url" content="instagram://media?id=POST_MEDIA_ID"/>
Obviously, the Instagram app must be installed on the device, otherwise the link will not work.

iOS universal links not working from gmail app

I have implemented iOS universal links to my app and everything is working fine when link is send to email and triggered from mail app, but not works when triggered from gmail app (opens link in embedded browser). I find out that some other app links such as Youtube or TestFlight is working from gmail app. Please help me to find out what I'm doing wrong.
Universal Links only work in Gmail under very specific circumstances: the embedded webview needs to be already open, so clicking a Universal Link directly from the text of an email doesn't work. You can find a list with more information here.
It's possible YouTube and TestFlight actually aren't using Universal Links to trigger those apps. I haven't looked at them recently.

Two iOS apps using the same Facebook app ID - is it possible?

I'm using the latest facebook iOS SDK (supporting SSO) to connect my iPhone app with facebook. So far so good..
Since my current app is free with ads, I would like to create another version without ads (which i will charge for). I prefer not to use the in-app purchase approach.
The problem i'm facing is that with the facebook SSO, I need to bind the iOS application to a URL which is based on the facebook app ID. Since I have only one facebook app to be used by both of the iphone apps, the two iOS apps are binded to the same URL and therefore when both of them are installed on a device the callback from facebook to my app does not work (or opens the other app instead).
Is there a solution for that besides creating another facebook app dedicated to the new version of the iphone app?
Thanks.
I had to use FBLoginView in my app, and none of this solutions worked. The only missing thing was that i needed to add a new entry in the plist file: FacebookUrlSchemeSuffix (documented here, in the Step 2).
Suppose that your App ID is 123456, what i had to do was:
1) In your facebook app, add a URL Scheme Suffix in the iOS section:
2) In both of your applications, go to the app's .plist, and add the following entry:
Note that the Value must be one of the URL Scheme Suffixes added.
3) Also change your URL Scheme for Facebook in the .plist file to fb. For example, fb123456client
In the latest Facebook iOS SDK on Github there's a method called authorize:delegate:localAppId: initWithAppId:urlSchemeSuffix:andDelegate:. You can use the localAppId urlSchemeSuffix parameter to distinguish multiple iOS Apps that use the same Facebook application id. The method documentation says:
urlSchemeSuffix is a string of lowercase letters that is appended to the base URL scheme used for SSO. For example, if your facebook ID is "350685531728" and you set urlSchemeSuffix to "abcd", the Facebook app will expect your application to bind to the following URL scheme: "fb350685531728abcd". This is useful if your have multiple iOS applications that share a single Facebook application id (for example, if you have a free and a paid version on the same app) and you want to use SSO with both apps. Giving both apps different urlSchemeSuffix values will allow the Facebook app to disambiguate their URL schemes and always redirect the user back to the correct app, even if both the free and the app is installed on the device.
urlSchemeSuffix is supported on version 3.4.1 and above of the Facebook app. If the user has an older version of the Facebook app installed and your app uses urlSchemeSuffix parameter, the SDK will proceed as if the Facebook app isn't installed on the device and redirect the user to Safari.

Resources