feat(firebase-x): add message typing (#4282)

This commit is contained in:
Yevhen 2022-09-05 20:04:10 +03:00 committed by GitHub
parent 99161e2b73
commit 898e0b8588
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,7 +112,19 @@ export interface FirebaseUser {
*/
name?: string;
}
export interface MessagePayload {
title: string;
body: string;
collapse_key: string;
from: string;
id: string;
messageType: string;
notification_foreground: string;
sent_time: string;
show_notification: string;
ttl: string;
tap?: 'background' | 'foreground';
}
/**
* @name Firebase X
* @description
@ -237,7 +249,7 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
@Cordova({
observable: true,
})
onMessageReceived(): Observable<any> {
onMessageReceived<T = { [key: string]: string }>(): Observable<MessagePayload & T> {
return;
}