Search in sources :

Example 21 with WritableMap

use of com.facebook.react.bridge.WritableMap in project react-native-push-notification by zo0r.

the class RNPushNotificationJsDelivery method notifyRemoteFetch.

void notifyRemoteFetch(Bundle bundle) {
    String bundleString = convertJSON(bundle);
    WritableMap params = Arguments.createMap();
    params.putString("dataJSON", bundleString);
    sendEvent("remoteFetch", params);
}
Also used : WritableMap(com.facebook.react.bridge.WritableMap)

Example 22 with WritableMap

use of com.facebook.react.bridge.WritableMap in project react-native-push-notification by zo0r.

the class RNPushNotificationJsDelivery method notifyNotification.

void notifyNotification(Bundle bundle) {
    String bundleString = convertJSON(bundle);
    WritableMap params = Arguments.createMap();
    params.putString("dataJSON", bundleString);
    sendEvent("remoteNotificationReceived", params);
}
Also used : WritableMap(com.facebook.react.bridge.WritableMap)

Example 23 with WritableMap

use of com.facebook.react.bridge.WritableMap in project react-native-push-notification by zo0r.

the class RNPushNotificationJsDelivery method notifyNotificationAction.

void notifyNotificationAction(Bundle bundle) {
    String bundleString = convertJSON(bundle);
    WritableMap params = Arguments.createMap();
    params.putString("dataJSON", bundleString);
    sendEvent("notificationActionReceived", params);
}
Also used : WritableMap(com.facebook.react.bridge.WritableMap)

Example 24 with WritableMap

use of com.facebook.react.bridge.WritableMap in project react-native-push-notification by zo0r.

the class RNPushNotification method registerNotificationsRegistration.

private void registerNotificationsRegistration() {
    IntentFilter intentFilter = new IntentFilter(getReactApplicationContext().getPackageName() + ".RNPushNotificationRegisteredToken");
    getReactApplicationContext().registerReceiver(new BroadcastReceiver() {

        @Override
        public void onReceive(Context context, Intent intent) {
            String token = intent.getStringExtra("token");
            WritableMap params = Arguments.createMap();
            params.putString("deviceToken", token);
            mJsDelivery.sendEvent("remoteNotificationsRegistered", params);
        }
    }, intentFilter);
}
Also used : Context(android.content.Context) ReactContext(com.facebook.react.bridge.ReactContext) ReactApplicationContext(com.facebook.react.bridge.ReactApplicationContext) IntentFilter(android.content.IntentFilter) WritableMap(com.facebook.react.bridge.WritableMap) Intent(android.content.Intent) BroadcastReceiver(android.content.BroadcastReceiver)

Example 25 with WritableMap

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

the class TitleBarSearchButton method onQueryTextSubmit.

@Override
public boolean onQueryTextSubmit(String query) {
    WritableMap arguments = Arguments.createMap();
    arguments.putString("query", query);
    sendEvent("searchQuerySubmit", arguments);
    return false;
}
Also used : WritableMap(com.facebook.react.bridge.WritableMap)

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