use of com.facebook.react.bridge.ReactMethod in project react-native-navigation by wix.
the class NavigationReactModule method showContextualMenu.
@ReactMethod
public void showContextualMenu(final String screenInstanceId, final ReadableMap params, final Callback onButtonClicked) {
ContextualMenuParams contextualMenuParams = new ContextualMenuParamsParser().parse(BundleConverter.toBundle(params));
NavigationCommandsHandler.showContextualMenu(screenInstanceId, contextualMenuParams, onButtonClicked);
}
use of com.facebook.react.bridge.ReactMethod in project react-native-fbsdk by facebook.
the class FBLoginManagerModule method logInWithPublishPermissions.
/**
* Attempts a Facebook login with the specified publish permissions.
* @param permissions must be one of the provided publish permissions. See
* <a href="https://developers.facebook.com/docs/facebook-login/permissions">
* Facebook login permissions</a>.
* @param promise Use promise to pass login result to JS after login finish.
*/
@ReactMethod
public void logInWithPublishPermissions(ReadableArray permissions, final Promise promise) {
final LoginManager loginManager = LoginManager.getInstance();
loginManager.registerCallback(mCallbackManager, new LoginManagerCallback(promise));
Activity activity = getCurrentActivity();
if (activity != null) {
loginManager.logInWithPublishPermissions(activity, reactArrayToJavaStringCollection(permissions));
}
}
use of com.facebook.react.bridge.ReactMethod in project react-native-fbsdk by facebook.
the class FBAppInviteDialogModule method show.
/**
* Helper to show the provided {@link com.facebook.share.model.AppInviteContent}.
* @param appInviteContentMap must be a valid {@link AppInviteContent}
* @param promise Use promise to pass the app invite dialog result to JS.
*/
@ReactMethod
public void show(ReadableMap appInviteContentMap, Promise promise) {
if (getCurrentActivity() != null) {
AppInviteDialog appInviteDialog = new AppInviteDialog(getCurrentActivity());
AppInviteContent appInviteContent = Utility.buildAppInviteContent(appInviteContentMap);
appInviteDialog.registerCallback(getCallbackManager(), new AppInviteDialogCallback(promise));
appInviteDialog.show(appInviteContent);
} else {
promise.reject("No current activity.");
}
}
use of com.facebook.react.bridge.ReactMethod in project react-native-orientation-locker by wonday.
the class OrientationModule method lockToPortraitUpsideDown.
@ReactMethod
public void lockToPortraitUpsideDown() {
final Activity activity = getCurrentActivity();
if (activity == null)
return;
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT);
this.isLocked = true;
}
use of com.facebook.react.bridge.ReactMethod in project react-native-fcm by evollu.
the class FIRMessagingModule method presentLocalNotification.
@ReactMethod
public void presentLocalNotification(ReadableMap details) {
Bundle bundle = Arguments.toBundle(details);
mFIRLocalMessagingHelper.sendNotification(bundle);
}
Aggregations