[fcm] Fix getInitialMessage; Handle a few more android fields
This commit is contained in:
parent
7cac981468
commit
1ddc76616d
|
@ -69,7 +69,6 @@ public class RNFirebaseMessaging extends ReactContextBaseJavaModule implements A
|
|||
|
||||
@ReactMethod
|
||||
public void requestPermission(Promise promise) {
|
||||
// TODO: Object structure?
|
||||
promise.resolve(null);
|
||||
}
|
||||
|
||||
|
@ -190,6 +189,10 @@ public class RNFirebaseMessaging extends ReactContextBaseJavaModule implements A
|
|||
messageMap.putString("messageId", extras.getString("google.message_id"));
|
||||
} else if (key.equals("google.sent_time")) {
|
||||
messageMap.putDouble("sentTime", extras.getLong("google.sent_time"));
|
||||
} else if (key.equals("google.ttl")) {
|
||||
messageMap.putDouble("ttl", extras.getDouble("google.ttl"));
|
||||
} else if (key.equals("_fbSourceApplicationHasBeenSet")) {
|
||||
// ignore known unneeded fields
|
||||
} else {
|
||||
dataMap.putString(key, extras.getString(key));
|
||||
}
|
||||
|
|
|
@ -139,7 +139,9 @@ export default class Messaging extends ModuleBase {
|
|||
}
|
||||
|
||||
getInitialMessage(): Promise<?Message> {
|
||||
return getNativeModule(this).getInitialMessage();
|
||||
return getNativeModule(this)
|
||||
.getInitialMessage()
|
||||
.then(message => new Message(this, message));
|
||||
}
|
||||
|
||||
hasPermission(): Promise<boolean> {
|
||||
|
|
Loading…
Reference in New Issue