$cordovaOauth.facebook IOS 9 GM issue

For Android and IOS 8 everything still works but with IOS 9 GM the in app browser opens and yields a blank screen no matter how long one waits. Has anyone else seen this?
Simple code that has not changed:

  $cordovaOauth.facebook("id-here", ["email"]
                ).then(function(result) {
                    console.log(result);
                }, function(error) {
                    console.log(error);
                });
1 Like

The cordova-plugin-white plugin does not seem to work with IOS 9 and the Facebook login. Perhaps a TTL issue on the Facebook server, I don’t know. The fix is to update the .plist file for IOS.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>NSAppTransportSecurity</key>
    <dict>
      <key>NSAllowsArbitraryLoads</key>
      <true/>
    </dict>
...

Thanks it’s thanks it worked !! For IOS 9

Yea I don’t think it is limited to just $cordovaOauth. I think the InAppBrowser all around is having issues. Thanks for reporting a temporary fix. Going to pass this on to other users of my library.

Best,

I agree. $cordovaOauth is acting as it should in IOS 9 given the check for week TTL (I suspect TLTL) at a server. Giving a specific white list permissions may be better than the fix I show above.

Would like to point out that the facebook method of $cordovaOauth needs work however to better handle this error. Its call to the inappbrowser hangs and never returns. The facebook method should set the inappbrowser as hidden on its launch and then check it events when it is ready to display. This way it could show a working message and time it out should it hang due to the freeze up. I will try to post such a fix as we are forced to incorporate this into our app.

Yea please open a ticket for me:

Always open to improvement.

after adding this

<key>NSAppTransportSecurity</key>
    <dict>
      <key>NSAllowsArbitraryLoads</key>
      <true/>
    </dict>

i am getting “The redirect_uri URL is not supported”… can you help me in this??? or did you find any permanent solution for this???

thanks

Hi !

Edit : Project => Ressources => Info.plist (right click => open as => source code)

Add this :

<key>NSAppTransportSecurity</key>
    <dict>
      <key>NSExceptionDomains</key>
      <dict>
        <key>facebook.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSTemporaryExceptionMinimumTLSVersion</key>
            <string>TLSv1.1</string>
        </dict>
      </dict>
    </dict>

Your app can be rejected by Apple if you use :

<key>NSAppTransportSecurity</key>
    <dict>
      <key>NSAllowsArbitraryLoads</key>
      <true/>
    </dict>
2 Likes

I tried this as it makes sense to declare a specific domain but it does not work. The loadstart event fires for the inappbrowser but loadstop does not. Seems no response comes back from facebook. NSAllowsArbitraryLoads does continue to work.

Hi All,

Sorry for my question but i’m new in developping hybrid app :wink:
I need to know which file i need to update for Oauth work correctly in IOS9. Because i find a lot of Info.plist on my Mac :frowning:

Thank’s a lot !

I think you need to edit this file :

projectName => platforms => ios => projectName => projectName-Info.plist

(“projectName” will be the name of your project)

@gregoiremotot Thank’s a lot !!! This is the good file :slight_smile:

1 Like

Hey, I’ve been unable to open the plist as source code. When I right click I only get the option to open with xcode. Please excuse the silly nature of the question. The answer might be staring right at me.

Hi !

  • Open the Xcode project (double click on projectName.xcodeproj)

image

  • Edit projectName-Info.plist

image

You’re the bomb. Thank you. This solved all of my problems.

1 Like