Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
made api version a configurable option, updated to version 3
  • Loading branch information
Jonathan Little authored and Jonathan Little committed Jun 29, 2018
1 parent 4f9f7ed commit ba29d92
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/oauth.facebook.js
Expand Up @@ -20,12 +20,16 @@
if(window.cordova) {
if($cordovaOauthUtility.isInAppBrowserInstalled()) {
var redirect_uri = "http://localhost/callback";
var api_version = "3.0";
if(options !== undefined) {
if(options.hasOwnProperty("redirect_uri")) {
redirect_uri = options.redirect_uri;
}
if(options.hasOwnProperty("api_version")) {
api_version = options.api_version;
}
}
var flowUrl = "https://www.facebook.com/v2.6/dialog/oauth?client_id=" + clientId + "&redirect_uri=" + redirect_uri + "&response_type=token&scope=" + appScope.join(",");
var flowUrl = "https://www.facebook.com/v" + api_version + "/dialog/oauth?client_id=" + clientId + "&redirect_uri=" + redirect_uri + "&response_type=token&scope=" + appScope.join(",");
if(options !== undefined && options.hasOwnProperty("auth_type")) {
flowUrl += "&auth_type=" + options.auth_type;
}
Expand Down

0 comments on commit ba29d92

Please sign in to comment.