Skip to content

Commit

Permalink
Share Dialog does not require Login or any extended permissions
Browse files Browse the repository at this point in the history
Currently user have to have an active session with Facebook plugin to use **"Share Dialog"**, but Facebook documentation suggest *". This does not require Facebook Login or any extended permissions, so it is the easiest way to enable sharing on web."*

This Change just request an active session when developer execute a showDialog different than a share dialog
  • Loading branch information
jcvalerio committed Dec 15, 2014
1 parent 9e72b3c commit 7517bc7
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,6 @@ public void onCompleted(GraphUser user, Response response) {
callbackContext.success();
return true;
} else if (action.equals("showDialog")) {
Session session = Session.getActiveSession();
if (!checkActiveSession(session)) {
callbackContext.error("No active session");
return true;
}
Bundle collect = new Bundle();
JSONObject params = null;
try {
Expand Down Expand Up @@ -391,6 +386,17 @@ public void onCompleted(GraphUser user, Response response) {
}
}
this.paramBundle = new Bundle(collect);

//The Share dialog prompts a person to publish an individual story or an Open Graph story to their timeline.
//This does not require Facebook Login or any extended permissions, so it is the easiest way to enable sharing on web.
boolean isShareDialog = this.method.equalsIgnoreCase("share") || this.method.equalsIgnoreCase("share_open_graph");
if (!isShareDialog) {
Session session = Session.getActiveSession();
if (!checkActiveSession(session)) {
callbackContext.error("No active session");
return true;
}
}

// Begin by sending a callback pending notice to Cordova
showDialogContext = callbackContext;
Expand Down

0 comments on commit 7517bc7

Please sign in to comment.