use of com.facebook.react.bridge.ReactMethod in project react-native-push-notification by zo0r.
the class RNPushNotification method presentLocalNotification.
@ReactMethod
public void presentLocalNotification(ReadableMap details) {
Bundle bundle = Arguments.toBundle(details);
// If notification ID is not provided by the user, generate one at random
if (bundle.getString("id") == null) {
bundle.putString("id", String.valueOf(mRandomNumberGenerator.nextInt()));
}
mRNPushNotificationHelper.sendToNotificationCentre(bundle);
}
use of com.facebook.react.bridge.ReactMethod in project react-native-push-notification by zo0r.
the class RNPushNotification method getInitialNotification.
@ReactMethod
public void getInitialNotification(Promise promise) {
WritableMap params = Arguments.createMap();
Activity activity = getCurrentActivity();
if (activity != null) {
Intent intent = activity.getIntent();
Bundle bundle = intent.getBundleExtra("notification");
if (bundle != null) {
bundle.putBoolean("foreground", false);
String bundleString = mJsDelivery.convertJSON(bundle);
params.putString("dataJSON", bundleString);
}
}
promise.resolve(params);
}
use of com.facebook.react.bridge.ReactMethod in project react-native-push-notification by zo0r.
the class RNPushNotification method requestPermissions.
@ReactMethod
public void requestPermissions(String senderID) {
ReactContext reactContext = getReactApplicationContext();
Intent GCMService = new Intent(reactContext, RNPushNotificationRegistrationService.class);
GCMService.putExtra("senderID", senderID);
reactContext.startService(GCMService);
}
use of com.facebook.react.bridge.ReactMethod in project react-native-navigation by wix.
the class NavigationReactModule method showSnackbar.
@ReactMethod
public void showSnackbar(final ReadableMap params) {
SnackbarParams snackbarParams = new SnackbarParamsParser().parse(BundleConverter.toBundle(params));
NavigationCommandsHandler.showSnackbar(snackbarParams);
}
use of com.facebook.react.bridge.ReactMethod in project react-native-navigation by wix.
the class NavigationReactModule method showSlidingOverlay.
@ReactMethod
public void showSlidingOverlay(final ReadableMap params) {
SlidingOverlayParams slidingOverlayParams = new SlidingOverlayParamsParser().parse(BundleConverter.toBundle(params));
NavigationCommandsHandler.showSlidingOverlay(slidingOverlayParams);
}
Aggregations