[notifications] First pass at notifications JS API

This commit is contained in:
Chris Bianca
2018-02-09 17:00:03 +00:00
parent 7b95613ec6
commit fb57dc5482
6 changed files with 971 additions and 41 deletions

View File

@@ -0,0 +1,25 @@
package io.invertase.firebase.notifications;
import android.support.v4.app.NotificationCompat;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
public class RNFirebaseNotifications extends ReactContextBaseJavaModule {
public RNFirebaseNotifications(ReactApplicationContext context) {
super(context);
}
@Override
public String getName() {
return "RNFirebaseNotifications";
}
@ReactMethod
public void sendNotification(Promise promise) {
//
NotificationCompat.Builder builder = new NotificationCompat.Builder()
}
}

View File

@@ -0,0 +1,37 @@
package io.invertase.firebase.notifications;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.UIManagerModule;
import com.facebook.react.uimanager.ViewManager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class RNFirebaseNotificationsPackage implements ReactPackage {
public RNFirebaseNotificationsPackage() {
}
/**
* @param reactContext react application context that can be used to create modules
* @return list of native modules to register with the newly created catalyst instance
*/
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new RNFirebaseNotifications(reactContext));
return modules;
}
/**
* @param reactContext
* @return a list of view managers that should be registered with {@link UIManagerModule}
*/
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList();
}
}