use of com.facebook.react.bridge.ReactMethod in project react-native-fcm by evollu.
the class FIRMessagingModule method scheduleLocalNotification.
@ReactMethod
public void scheduleLocalNotification(ReadableMap details) {
Bundle bundle = Arguments.toBundle(details);
mFIRLocalMessagingHelper.sendNotificationScheduled(bundle);
}
use of com.facebook.react.bridge.ReactMethod in project react-native-fcm by evollu.
the class FIRMessagingModule method getInitialNotification.
@ReactMethod
public void getInitialNotification(Promise promise) {
Activity activity = getCurrentActivity();
if (activity == null) {
promise.resolve(null);
return;
}
promise.resolve(parseIntent(activity.getIntent()));
}
use of com.facebook.react.bridge.ReactMethod in project react-native-gesture-handler by kmagiera.
the class RNGestureHandlerModule method createGestureHandler.
@ReactMethod
public void createGestureHandler(String handlerName, int handlerTag, ReadableMap config) {
for (int i = 0; i < mHandlerFactories.length; i++) {
HandlerFactory handlerFactory = mHandlerFactories[i];
if (handlerFactory.getName().equals(handlerName)) {
GestureHandler handler = handlerFactory.create(getReactApplicationContext());
handler.setTag(handlerTag);
handler.setOnTouchEventListener(mEventListener);
mRegistry.registerHandler(handler);
mInteractionManager.configureInteractions(handler, config);
handlerFactory.configure(handler, config);
return;
}
}
throw new JSApplicationIllegalArgumentException("Invalid handler name " + handlerName);
}
use of com.facebook.react.bridge.ReactMethod in project react-native-camera by react-native-community.
the class CameraModule method record.
@ReactMethod
public void record(final ReadableMap options, final int viewTag, final Promise promise) {
final ReactApplicationContext context = getReactApplicationContext();
final File cacheDirectory = mScopedContext.getCacheDirectory();
UIManagerModule uiManager = context.getNativeModule(UIManagerModule.class);
uiManager.addUIBlock(new UIBlock() {
@Override
public void execute(NativeViewHierarchyManager nativeViewHierarchyManager) {
final RNCameraView cameraView;
try {
cameraView = (RNCameraView) nativeViewHierarchyManager.resolveView(viewTag);
if (cameraView.isCameraOpened()) {
cameraView.record(options, promise, cacheDirectory);
} else {
promise.reject("E_CAMERA_UNAVAILABLE", "Camera is not running");
}
} catch (Exception e) {
promise.reject("E_CAMERA_BAD_VIEWTAG", "recordAsync: Expected a Camera component");
}
}
});
}
use of com.facebook.react.bridge.ReactMethod in project react-native-fbads by callstack.
the class AdSettingsManager method addTestDevice.
@ReactMethod
public void addTestDevice(String deviceHashedId) {
if (deviceHashedId.equals("current")) {
SharedPreferences sp = getReactApplicationContext().getSharedPreferences("FBAdPrefs", 0);
deviceHashedId = sp.getString("deviceIdHash", null);
}
AdSettings.addTestDevice(deviceHashedId);
}
Aggregations