I recently updated my copy of Xcode, and with that came the glorious App Transport Security changes.
I fixed those by updating my plist file accordingly, and then decided I would update the Facebook plugin in my app so that it used the v4 plugin (I’d been putting it off for a while).
As far as I can tell I’ve updated everything correctly as per the migration guide. However when I try to call facebook.login, it switches to the FB app as expected, but then when it comes back to my app the Facebook listener receives the following event:
table: 0x1dcf7560 { [type] =\> "session" [name] =\> "fbconnect" [phase] =\> "loginCancelled" [isError] =\> false [response] =\> "" }
I don’t get receive other events in the listener at all, just the cancelled one. Other than clicking the button in my game which triggers the login call, I haven’t touched anything else on screen so I’m definitely not hitting a cancel button.
In addition, this is an app that I have already signed into FB with,so it doesn’t even show me the “do you want to allow this app to sign in” page. It just goes to Facebook and then straight back to my app with no interaction on my part, and then says the login was cancelled.
The whole process takes maybe…5 seconds so I don’t think it’s timing out.
I’m fairly sure related to ATS, but as far as I can tell should not be happening due to my plist settings. When the login call is made I see this in my console:
error: "This app is not allowed to query for scheme fbXXXXXXXXXXXXXX"
where fbXXXXXXXXXXXXXX is my facebook app ID.
I already have “fbXXXXXXXXXXXXXX” in my plist’s LSApplicationQueriesSchemes array, and in NSAppTransportSecurity->NSExceptionDomains I also have facebook.com, graph.facebook.com, fbcdn.net and akamaihd.net
All fields also have the following keys:
\<key\>NSIncludesSubdomains\</key\> \<true/\> \<key\>NSExceptionAllowsInsecureHTTPLoads\</key\> \<true/\> \<key\>NSExceptionRequiresForwardSecrecy\</key\> \<false/\>
What else could be needed in order to get this to work correctly?