Skip to content

Commit

Permalink
feat(social): add social facebook pages manager
Browse files Browse the repository at this point in the history
  • Loading branch information
emersonlaurentino committed Dec 15, 2017
1 parent 9a9f94d commit 2537d3f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions android/src/main/java/cl/json/RNShareModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import cl.json.social.EmailShare;
import cl.json.social.FacebookShare;
import cl.json.social.FacebookPagesManagerShare;
import cl.json.social.GenericShare;
import cl.json.social.GooglePlusShare;
import cl.json.social.ShareIntent;
Expand All @@ -31,6 +32,7 @@ public RNShareModule(ReactApplicationContext reactContext) {
this.reactContext = reactContext;
sharesExtra.put("generic", new GenericShare(this.reactContext));
sharesExtra.put("facebook", new FacebookShare(this.reactContext));
sharesExtra.put("pagesmanager", new FacebookPagesManagerShare(this.reactContext));
sharesExtra.put("twitter", new TwitterShare(this.reactContext));
sharesExtra.put("whatsapp",new WhatsAppShare(this.reactContext));
sharesExtra.put("googleplus",new GooglePlusShare(this.reactContext));
Expand Down
39 changes: 39 additions & 0 deletions android/src/main/java/cl/json/social/FacebookPagesManager.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package cl.json.social;

import android.content.ActivityNotFoundException;

import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReadableMap;

/**
* Created by disenodosbbcl on 23-07-16.
*/
public class FacebookPagesManagerShare extends SingleShareIntent {

private static final String PACKAGE = "com.facebook.pages.app";
private static final String DEFAULT_WEB_LINK = "https://www.facebook.com/sharer/sharer.php?u={url}";

public FacebookPagesManagerShare(ReactApplicationContext reactContext) {
super(reactContext);
}
@Override
public void open(ReadableMap options) throws ActivityNotFoundException {
super.open(options);
// MORE DATA
this.openIntentChooser();
}
@Override
protected String getPackage() {
return PACKAGE;
}

@Override
protected String getDefaultWebLink() {
return DEFAULT_WEB_LINK;
}

@Override
protected String getPlayStoreLink() {
return null;
}
}

0 comments on commit 2537d3f

Please sign in to comment.