Closed mojocakes closed 7 years ago
Hey @mojocakes,
Does anything from https://github.com/nraboy/ng-cordova-oauth/issues/331 apply to you? The user was having a problem like this, but it is his environment / deployment strategy.
If you crack open the library source code, you might run into these lines:
https://github.com/nraboy/ng-cordova-oauth/blob/master/src/oauth.facebook.js#L20-L21
The first checks to see if you're using Apache Cordova in application format rather than trying to serve it using things like Ionic Serve, Live-Reload, Ionic View, etc. The second checks to make sure you have the InAppBrowser plugin installed.
Using plugins like WKWebView and CrossWalk will disrupt how web views work within the application. This will also cause the library to fail if you're using them.
In short though, the error is not related to how you've configured Facebook, but how your environment is setup and how you're deploying the application.
Best,
I've found the issue, for whatever reason cordova.js wasn't being loaded on the page. Thanks for your help @nraboy, linking to the code pointed me in the right direction
Glad you got it :-)
Hi, when using the following code I receive the error message "Cannot authenticate via a web browser".
This happens both in the iOS simulator and on an iPhone 6 device.
I have set up the cordova whitelist plugin and enabled access to the relevant oauth urls. My facebook app has "http://localhost/callback" set as the redirect URI. I've also enabled "Embedded Browser OAuth Login" in the facebook app. Is there something else I might be missing?