Facebook Android Sharing a Link Example Missing PERMISSIONS List

348 Views Asked by At

I am following the Sharing a link using API calls example on the Facebook Developers site. I am attempting to incorporate the sample publishStory() method into my Fragment. However I am missing the boolean pendingPublishReauthorization and a list PERMISSIONS.

I cannot find previous examples that refer to these variables on the developer site. Has anyone else encountered this, or do they know what these variables are supposed to refer to?

I imagine I can just declare the boolean. I am more concerned about the list.

enter image description here

1

There are 1 best solutions below

0
On

I have found the solution on another Stackoverflow Post

In short, these variables are simply declared. The boolean is initialized to false, and PERMISSIONS is initialized with a String

private static final List<String> PERMISSIONS = Arrays.asList("publish_actions");
private boolean pendingPublishReauthorization = false;

I was also missing the private method isSubsetOf

private boolean isSubsetOf(Collection<String> subset, Collection<String> superset) {
  for (String string : subset) {
    if (!superset.contains(string)) {
      return false;
    }
  }
  return true;
}