You can continue to use URL schemes when you build your app for iOS 9 and you want to call URL schemes, you will now need to declare them in your apps Info.plist. There is a new key, LSApplicationQueriesSchemes, and here you will need to add the list of schemes you want to are canOpenURL on.
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbauth2</string>
</array>
If you are using iOS9 then this is important to update your info.plist file. You just need to do 3 steps 1. Go to info.plist 2. Add a field namely LSApplicationQueriesSchemes NSArray datatype. 3. Add an item of NSString datatype name it as fbauth2.
Thats it. Just clean and run. warning wont show again.
As to v4.6.0 of the FaceBook SDK, add the following key into your plist file:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
Link: https://developers.facebook.com/docs/ios/ios9
Just follow the Facebook explanation: Preparing Your Apps for iOS9
Apple mention it in their:Privacy and Your App Keynote 2015
Please just do not add this to your CFBundleURLSchemes... that will actually HIJACK any app's attempt at Facebook auth, causing a popup to show "X app wants to open " dialog...
You DO NOT want to be doing that.
cf:
https://developers.facebook.com/docs/applinks/ios
https://www.fireeye.com/blog/threat-research/2015/04/url_masques_on_apps.html
https://www.reddit.com/r/workflow/comments/2tlx29/get_url_scheme_of_any_app
I got this when running my Kiwi tests as our test target didn't have access to main bundle. So I had to add a condition to isRegisteredCanOpenURLScheme
in FBSDKInternalUtility.m
+ (BOOL)isRegisteredCanOpenURLScheme:(NSString *)urlScheme
{
static dispatch_once_t fetchBundleOnce;
static NSArray *schemes = nil;
dispatch_once(&fetchBundleOnce, ^{
schemes = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"LSApplicationQueriesSchemes"];
if (!schemes) { // This is a work around for our Kiwi tests as the Specs target doesn't have access to main bundle
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
NSString *path = [bundle pathForResource:@"Info" ofType:@"plist"];
NSDictionary *dictionary = [NSDictionary dictionaryWithContentsOfFile:path];
schemes = [dictionary valueForKey:@"LSApplicationQueriesSchemes"];
}
});
return [schemes containsObject:urlScheme];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With