iOS open app not in whitelist - ios

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.

Related

iOS: Universal Linking add restrictions

There are 2 Apps in my case say App A and App B.
I want to use universal link to open App B from App A and do some authentication work. I will be sending some result from App B to App A after it completes authentication via App A universal link.
But the use case I am troubled about is I do not want any other app to open App B.
If my HTTPS universal linking URL gets exposed, I know that universal links can not work directly from browser but someone can create malicious app and can try to open the universal link from malicious app.
Is there any solution to that? Like restricting what apps can open App B via universal linking?
Please correct me if my understanding is wrong.
The developer of a malicious app cannot intercept ANY link they want, that's what your apple-app-site-assotiation is for. The connection between the app and the site works both way:
In your app you need to put a domain to your website.
Under <your_domain>/.well-known/apple-app-site-assotiation you've got to put appID and only the app with that specific appID will be eligible to handle URLs to of this domain.
Hope it answers your question.

How to handle facebook login with multiple targets?

Here is my setup:
I have quite a few targets to run an app on the white-label method.
So each target has its own Info.plist, icons, names, etc.
The thing is that I want to have one login system only with facebook. So they all point to the same facebook app.
The problem: sometimes, when I login on app A using facebook, the facebook app open the app B.
I have all setup following the facebook guide with all bundle ids registered on facebook app, etc.
Has anyone had this issue before?
Solved it by forcing facebook login behavior to stay on a webview.
loginBehavior = FBSDKLoginBehaviorWeb
This way the users never leaver the app, so there is no chance of returning on a scheme opening the wrong app.

Get the app back ince you delete that app from App requests and activity Facebook Settings

I have accidently removed my app from App requests and activity Facebook Settings. Now when i press facebook login in the my third party app. It does nothing. How can i gety the app back in Facebook Setting in App requests and activity settings?
Please try to reset .plist settings.

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

How does facebook call the native iOS app?

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.

Resources