How does facebook call the native iOS app? - ios

I want to know how does facebook native app call my native iOS app.
Facebook requires App bundle id, app store id, and url sufix (optional). What I want to know is: how facebook process these information and open my native app?

It uses custom URL schemes.
What you basically do is define a "url" for your app so you can access it from anywhere in the OS (using that URL). What FB does, when it opens Safari to authenticate you for example, is specify YOUR app's custom url as a callback URL, so when it finishes, it calls that url and that redirects it back to your app.
You can test this by setting a custom URL for your app, firing up Safari, and typing that url. It will jump straight to your app.
You can read more about it here.

You don't need to set any of that to have the Facebook app send you back to your own app. The SDK does that automatically.
Setting the app bundle ID in your Facebook app (in the Facebook developer center) allows the Facebook app to send the user immediately back to your app if they've already given permission to your app before. It's just a nice feature, but it's not necessary for everything to work.

Related

clevertap Deeplink notification is redirecting to safari instead of mobile app when app is in background

clevertap Deeplink notification is redirecting to safari instead of mobile app when app is in background ,
Can any one help on me on this
I believe you are trying to understand why your Deeplink is opening in the browser first and then redirecting you to the Application
If a deep link starts with HTTPS on iOS devices, the default behavior
is to open that link in the browser. If you have implemented a
universal link, safari will show you a banner at the top asking if you
want to open it in the app.
You can read about it more here:-
https://developer.apple.com/documentation/xcode/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app
If you would like to open the app directly from the push notification
using an HTTPS link, you should not include the URL in the deep link
input field. You can instead pass the HTTPS: deep link as a custom
key-value pair, then In you app you can read the custom key-value pair
and decide the redirection logic, or if you don't wanna pass URL, you can also pass an identifier which needs to be handled in your app.
Please check this image for more Information:

iOS open app not in whitelist

Currently I want to make an app that other app can auth login by opening my app, just like Facebook do. App A click login by MyApp, A app open MyApp, then MyApp auth the app and go back to app A.
Obviously A app should add my app scheme to its whitelist and use openURL: function to open MyApp but how can I go back to app A when I finish auth? I don't think Facebook have all the apps in its whitelist because there are thousands of apps using Facebook login.
Someone know the answer? Thanks.
Actually openURL: ignores LSApplicationQueriesSchemes.
Check for whitelisted URL performed in canOpenURL:.
So just open callback url, don't perform check.

Facebook Request Notification not showing in iOS mobile safari but in native facebook app

Use-case: I sent a request from my game to friend x. Friend x gets a notification in his native Facebook app, taps it and the game opens. If he opens the safari mobile page of Facebook the same notification is never shown.
Is there a way to enable request notifications to appear in the mobile website of facebook?
My game has an Facebook iOS App enabled, the bundle identifier is set and the Store ID is set.
The Facebook App runs in developement Mode.
well what i did to acomplish a similar result... Open my app from a button in an email... is using URL Schemes..
basically everything you need to do is modify your info.plist file and then your are ready to go.
whenever the device sends a request for example myapp:// ... (from a browser, another app, etc.) ... then your app will show up
here is an image with an example.. hope it helps
GL HF

How to handle URLs from Facebook Open Graph actions in iOS app

I'm building an iOS app that has Facebook open graph actions, and when I post an action on Facebook, on mobile app, I'm getting a link to my mobile app's ID on the App Store, which is not available yet. As a placeholder (otherwise Facebook doesn't save my settings), I've put an ID of another app that I have. Whenever I tap an Open Graph story on Facebook from my new app in Facebook iOS app, An App Store page of my previous app opens. I need the functionality to handle open graph action taps from Facebook iOS app before I submit my app to App Store. How can I test URL handling functionality in a such scenario?
Here is how my Facebook Native iOS App dashboard looks like:
Bundle ID matches my app's ID in my app exactly. iPhone/iPad App Store ID links to one of my previous apps, else Facebook doesn't accept my settings when I click Save button, complaining about app not yet being available on App Store. Facebook login and deep linking are both enabled, and URL schemes are registered the same way (the one starting with fb continues with my Facebook app ID) in the app bundle too. But still, my app doesn't launch when I tap a story on Facebook mobile app. Instead, a popup to install the app with the ID that I've specified launches (though, weird enough, I have that app installed too).
Facebook documents this here: https://developers.facebook.com/docs/ios/link-to-your-native-app-ios-sdk/
Just look under How to handle deep links to provide a more relevant user experience

Facebook App Requests aren't shown on iOS devices?

I've sent an app invitation from an iPad app to a test Facebook account via Facebook's API. When I login to the test account on my PC, the app request is there.
When I login to the test account on my iPad (either via Safari or via the Facebook App), I can see the number "1" next to the App Centre tab, but when I click it and go to the App Centre, there's no request. In fact, I can't see any App Centre areas dedicated to requests on Facebook for iOS - there's only Social Picks and Top Apps. Any explanation for this?
This is caused by an incorrect configuration on the Facebook app setting page. When you are setting up the app, you need to make sure the following is set correctly.
Go to developers.facebook.com then select "Apps". Edit your app and fill in the following..
iOS App Bundle (dont think it's essential but fill it in, this the bundle id from Xcode (com.companyname.appname))
iPhone/iPad App Store ID - This is ESSENTIAL, one of these must be filled in with a valid app store ID. You get this when you create an app with iTunes Connect. If you create an app, and fill in the details right up to the point where it asks you to submit the binary, it will generate what Apple refers to as an Apple ID (or iTunes Id?). It's just a long integer value. It doesn't have to be for the corresponding app, if you already have apps in the app store just log in to iTunes connect and use an existing one for testing.
Configured for iOS SSO - Enabled
Configured for Deep Linking - Enabled
The only functionality you get from Facebook when a user clicks an app notification on iOS is the user being redirected to the app, if installed, or to the App Store if not. Also if you want your app notifications to show up on desktop, you'll need a Canvas URL under the "App On Facebook" section.
In my tests I had to have a canvas URL to get iOS notifications working, but I'm not sure if this is a bug with Facebook or intended behaviour, so if it doesn't work with just iOS enabled, enable app on Facebook too and stick in a random url if you don't have one.
I just figured there can be another reason for this symptom: if your app has location restriction (only available in certain countries), the user who receives the request has to be in that country (e.g. I had to connect with mine via GeoEdge).

Resources