sahat / satellizer

Token-based AngularJS Authentication
https://satellizer-sahat.rhcloud.com
MIT License
7.85k stars 1.13k forks source link

XCode Failed to load webpage with error: Could not connect to the server. #651

Open rrNuvoPoint opened 8 years ago

rrNuvoPoint commented 8 years ago

Hello,

When i try to use cordova with satellizer i get the output as title above in xcode. This happens after i log in to facebook so the popup works fine.

Cordova is loaded. I checked by: console.log(!!window.cordova);

I did set the settings: $authProvider.cordova = true; commonConfig.redirectUri = 'http://localhost/';

And i made sure to use cors() on the backend.

I tried to change the code to see if this had anything to do with it.

skaermbillede 2015-11-21 kl 15 38 02

The only logs i receive is those that state that the event handler has been attached. No other events are ever executed.

This can be seen here:

skaermbillede 2015-11-21 kl 15 37 50

Plugins

skaermbillede 2015-11-21 kl 16 39 06

EDIT: I just added inAppBrowser and then it work. Do i HAVE to have it?

sahat commented 8 years ago

586. I am currently working on switching to system browser instead (Safari for iOS, Chrome for Android), but may need some help on that.

The problem arises because of a more complex app <----> browser communication. Once Safari gets the code, how do you tell it to close the window and go back to the native app?

rrNuvoPoint commented 8 years ago

I will try to look at it. However i might think that the solution will be that inappbrowser is required and that some code could be added to "log out" of the social provider in the inappbrowser plugin.

This is mainly due to the fact that opening in the native browser will require some sort of native code.

rrNuvoPoint commented 8 years ago

The documentation states that it will be possible to change the opening of the popup window to this:

var options = {clearsessioncache: 'yes', clearcache: 'yes'};
var ref = cordova.InAppBrowser.open(url, target, options);

This will only work for iOS and Android tho. NOT windows phone. But i guess it will be supported by them later.