Open app with URL Scheme from Facebook - ios

I'm trying to open my iOS app from my Facebook page throught a custom URL Scheme.
I tried to add a custom URL Scheme in my app (and if I type it in Safari my app opens), I tried to add Facebook SDK in my app, configuring info.plist with all parameters like app ID and FacebookUrlScheme, but my app does not open in any case.
I don't have any other ideas and I didn't find any guide or tutorial for this.

Related

How to open application using URL?

I have implemented all the required things but had no success. I want to open the application from browser - but not with just URL schema like a "callback".
I have something like "http://11.11.21.114:8081/signup/callback?signupCode=123?id=20" so how can I identify this url to open my application?
Use Universal Links
But it will only work with Public website URL, that should be accessible to Apple Servers.
The only thing you need is to have https server and access to upload a associated domains file.
When you support universal links, iOS 9 users can tap a link to your
website and get seamlessly redirected to your installed app without
going through Safari. If your app isn’t installed, tapping a link to
your website opens your website in Safari.
Apple Link : => Support Universal Links
Follow this nice tutorial : => Universal Link
Add Innformation In Info.Plist File
In Url Identifier Enter Your Package Name && Url schemes add
Application Name
open link like schemesname:// Then Open Your App
To Launch application from Url , Deep Link is used . Here is tutorial for complete step by step for opening application :
http://blog.originate.com/blog/2014/04/22/deeplinking-in-ios/
Once its done , just add url into Xcode Plist file , then passing url on browser will launch iOS Application.
Hope it Helps!

Facebook App Links don't open my app

I have added my URL scheme to my .plist.
I have manually tested the scheme in Safari and confirmed that it launches my app just fine.
I have generated a hosted app links link that uses the scheme.
Nothing except my own URL was entered when creating the hosted app link.
When I tap the link on my phone (with my app installed) it takes me to a page with the text You have reached an implementation detail. It's pretty obvious that Facebook didn't even try to use the URL that I had provided when creating this hosted app link.
I should add that I have successfully created other hosted app links moments before that managed to redirect to webpages and to appstore, so there's nothing wrong with mobile Safari.
Where to go from here?
Edit: My app is, of course, in development.
I was having the same issue until i updated my app settings in the facebook developer site.
In the image for #1 you enter the prefix (even though it says suffix...) for your url scheme (ex: if you use myapp://testing/here, then enter "myapp" into the field)
make sure #2 is flipped to yes
Facebook iOS Settings
This is an old thread, but after spending some time on this I realized that the https://fb.me/... links only open from within the Facebook app on the device. They will not (and are not intended) to open from a web browser. After posting the link in a Facebook group I was able to successfully open my app with it.

Facebook redirection issue in iOS 9

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.

Deep linking to iOS app through Facebook share

Currently is it possible to do a deep link on a Facebook share post? Here is the use case I'm trying to implement:
I go to a post on my website: http://www.helloworld.com/share-this-post.html and use FB share to share the link.
I open the iOS Facebook app on my phone and click on the link I just shared.
Then if I have the native HelloWorld iOS app installed on my phone, Facebook will open up my native app instead of opening the link in a webview. Else it will take me to the app store to download my native app.
Thanks!
I think the basic idea here is a URL Scheme that you need to create. When a user does the actions necessary to open your app send them to this URL -> which opens your app or takes them to the app store to purchase your app.
Do a quick google search on how to create a URL scheme, its quite simple.
Does this answer your question?

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