Search in sources :

Example 6 with ReactMethod

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);
}
Also used : ContextualMenuParams(com.reactnativenavigation.params.ContextualMenuParams) ContextualMenuParamsParser(com.reactnativenavigation.params.parsers.ContextualMenuParamsParser) ReactMethod(com.facebook.react.bridge.ReactMethod)

Example 7 with ReactMethod

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));
    }
}
Also used : LoginManager(com.facebook.login.LoginManager) Activity(android.app.Activity) ReactMethod(com.facebook.react.bridge.ReactMethod)

Example 8 with ReactMethod

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.");
    }
}
Also used : AppInviteDialog(com.facebook.share.widget.AppInviteDialog) AppInviteContent(com.facebook.share.model.AppInviteContent) ReactMethod(com.facebook.react.bridge.ReactMethod)

Example 9 with ReactMethod

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;
}
Also used : Activity(android.app.Activity) ReactMethod(com.facebook.react.bridge.ReactMethod)

Example 10 with ReactMethod

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);
}
Also used : Bundle(android.os.Bundle) ReactMethod(com.facebook.react.bridge.ReactMethod)

Aggregations

ReactMethod (com.facebook.react.bridge.ReactMethod)82 Activity (android.app.Activity)21 Intent (android.content.Intent)11 WritableMap (com.facebook.react.bridge.WritableMap)11 Bundle (android.os.Bundle)9 ReactApplicationContext (com.facebook.react.bridge.ReactApplicationContext)6 WritableArray (com.facebook.react.bridge.WritableArray)6 ArrayList (java.util.ArrayList)5 Camera (android.hardware.Camera)4 NativeViewHierarchyManager (com.facebook.react.uimanager.NativeViewHierarchyManager)4 UIBlock (com.facebook.react.uimanager.UIBlock)4 UIManagerModule (com.facebook.react.uimanager.UIManagerModule)4 ShareContent (com.facebook.share.model.ShareContent)4 LayoutNode (com.reactnativenavigation.options.LayoutNode)4 LoginManager (com.facebook.login.LoginManager)3 ReactActivity (com.facebook.react.ReactActivity)3 LatLng (com.google.android.gms.maps.model.LatLng)3 ActivityNotFoundException (android.content.ActivityNotFoundException)2 RemoteException (android.os.RemoteException)2 JSApplicationIllegalArgumentException (com.facebook.react.bridge.JSApplicationIllegalArgumentException)2