Search in sources :

Example 51 with WritableMap

use of com.facebook.react.bridge.WritableMap in project gl-react-native by ProjectSeptemberInc.

the class RNGLContext method shaderSucceedToCompile.

public void shaderSucceedToCompile(Integer id, Map<String, Integer> uniformTypes) {
    Callback onCompile = onCompileCallbacks.get(id);
    onCompileCallbacks.remove(id);
    if (onCompile != null) {
        WritableMap res = Arguments.createMap();
        WritableMap uniforms = Arguments.createMap();
        for (String key : uniformTypes.keySet()) {
            uniforms.putString(key, glTypeString(uniformTypes.get(key)));
        }
        res.putMap("uniforms", uniforms);
        onCompile.invoke(null, res);
    }
}
Also used : Callback(com.facebook.react.bridge.Callback) WritableMap(com.facebook.react.bridge.WritableMap)

Example 52 with WritableMap

use of com.facebook.react.bridge.WritableMap in project react-native-android-video-editor by RZulfikri.

the class VideoSurfaceView method notifyProgressUpdate.

public void notifyProgressUpdate(boolean status) {
    //         Log.e("DEBUG", "UPDATE PROGRESS");
    WritableMap event = Arguments.createMap();
    event.putInt(Events.VIDEO_PROGRESS, mMediaPlayer.getCurrentPosition());
    eventEmitter.receiveEvent(getId(), EventsEnum.EVENT_GET_VIDEO_PROGRESS.toString(), event);
}
Also used : WritableMap(com.facebook.react.bridge.WritableMap)

Example 53 with WritableMap

use of com.facebook.react.bridge.WritableMap in project react-native-navigation by wix.

the class EventEmitter method sendScreenChangedEventToJsScreen.

private void sendScreenChangedEventToJsScreen(String eventId, String navigatorEventId) {
    WritableMap map = Arguments.createMap();
    map.putString("type", "ScreenChangedEvent");
    sendNavigatorEvent(eventId, navigatorEventId, map);
}
Also used : WritableMap(com.facebook.react.bridge.WritableMap)

Example 54 with WritableMap

use of com.facebook.react.bridge.WritableMap in project react-native-fcm by evollu.

the class FIRMessagingModule method registerMessageHandler.

private void registerMessageHandler() {
    IntentFilter intentFilter = new IntentFilter("com.evollu.react.fcm.ReceiveNotification");
    LocalBroadcastManager.getInstance(getReactApplicationContext()).registerReceiver(new BroadcastReceiver() {

        @Override
        public void onReceive(Context context, Intent intent) {
            if (getReactApplicationContext().hasActiveCatalystInstance()) {
                RemoteMessage message = intent.getParcelableExtra("data");
                WritableMap params = Arguments.createMap();
                WritableMap fcmData = Arguments.createMap();
                if (message.getNotification() != null) {
                    Notification notification = message.getNotification();
                    fcmData.putString("title", notification.getTitle());
                    fcmData.putString("body", notification.getBody());
                    fcmData.putString("color", notification.getColor());
                    fcmData.putString("icon", notification.getIcon());
                    fcmData.putString("tag", notification.getTag());
                    fcmData.putString("action", notification.getClickAction());
                }
                params.putMap("fcm", fcmData);
                params.putString("collapse_key", message.getCollapseKey());
                params.putString("from", message.getFrom());
                params.putString("google.message_id", message.getMessageId());
                params.putDouble("google.sent_time", message.getSentTime());
                if (message.getData() != null) {
                    Map<String, String> data = message.getData();
                    Set<String> keysIterator = data.keySet();
                    for (String key : keysIterator) {
                        params.putString(key, data.get(key));
                    }
                }
                sendEvent("FCMNotificationReceived", params);
            }
        }
    }, intentFilter);
}
Also used : Context(android.content.Context) ReactApplicationContext(com.facebook.react.bridge.ReactApplicationContext) IntentFilter(android.content.IntentFilter) RemoteMessage(com.google.firebase.messaging.RemoteMessage) WritableMap(com.facebook.react.bridge.WritableMap) Set(java.util.Set) Intent(android.content.Intent) BroadcastReceiver(android.content.BroadcastReceiver) Map(java.util.Map) ReadableMap(com.facebook.react.bridge.ReadableMap) WritableMap(com.facebook.react.bridge.WritableMap) Notification(com.google.firebase.messaging.RemoteMessage.Notification)

Aggregations

WritableMap (com.facebook.react.bridge.WritableMap)54 ReactContext (com.facebook.react.bridge.ReactContext)5 ThemedReactContext (com.facebook.react.uimanager.ThemedReactContext)4 Intent (android.content.Intent)3 WritableNativeMap (com.facebook.react.bridge.WritableNativeMap)3 RCTEventEmitter (com.facebook.react.uimanager.events.RCTEventEmitter)3 IOException (java.io.IOException)3 BroadcastReceiver (android.content.BroadcastReceiver)2 Context (android.content.Context)2 IntentFilter (android.content.IntentFilter)2 MediaMetadataRetriever (android.media.MediaMetadataRetriever)2 Bundle (android.os.Bundle)2 View (android.view.View)2 Callback (com.facebook.react.bridge.Callback)2 ReactApplicationContext (com.facebook.react.bridge.ReactApplicationContext)2 ReadableMap (com.facebook.react.bridge.ReadableMap)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 JSONArray (org.json.JSONArray)2 JSONObject (org.json.JSONObject)2