This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Source: https://github.com/expo/expo/blob/master/packages/expo-facebook/ios/EXFacebook/EXFacebook.m#L127-L177 | |
UM_EXPORT_METHOD_AS(logInWithReadPermissionsAsync, | |
logInWithReadPermissionsWithConfig:(NSDictionary *)config | |
resolver:(UMPromiseResolveBlock)resolve | |
rejecter:(UMPromiseRejectBlock)reject) | |
{ | |
if (![FBSDKSettings appID]) { | |
reject(EXFacebookMisconfiguredErrorDomain, @"No appId configured, required for initialization. Please ensure that you're either providing `appId` to `initializeAsync` as an argument or inside Info.plist.", nil); | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String PUBLISH_PERMISSION_PREFIX = "publish"; | |
private static final String MANAGE_PERMISSION_PREFIX = "manage"; | |
private static final String EXPRESS_LOGIN_ALLOWED = "express_login_allowed"; | |
private static final String PREFERENCE_LOGIN_MANAGER = "com.facebook.loginManager"; | |
private static final Set<String> OTHER_PUBLISH_PERMISSIONS = getOtherPublishPermissions(); | |
//source https://github.com/facebook/facebook-android-sdk/blob/1d9c7b1fe699389e25b44e3c52adac7e09df166d/facebook-common/src/main/java/com/facebook/login/LoginManager.java#L578-L588 | |
private static Set<String> getOtherPublishPermissions() { | |
HashSet<String> set = | |
new HashSet<String>() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Source: https://github.com/expo/expo/blob/master/packages/expo-facebook/android/src/main/java/expo/modules/facebook/FacebookModule.java#L153-L217 | |
@ExpoMethod | |
public void logInWithReadPermissionsAsync(final ReadableArguments config, final Promise promise) { | |
if (FacebookSdk.getApplicationId() == null) { | |
promise.reject(ERR_FACEBOOK_MISCONFIGURED, "No appId configured, required for initialization. " + | |
"Please ensure that you're either providing `appId` to `initializeAsync` as an argument or inside AndroidManifest.xml."); | |
} | |
// Log out |