mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 18:49:43 +08:00
fix(firebase-messaging): fix the typings of the FCM message payload (#2998)
This commit is contained in:
parent
c0ce17b170
commit
e47774b771
@ -2,11 +2,35 @@ import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
export interface IFirebaseMessage {
|
||||
aps: any;
|
||||
gcm: any;
|
||||
export interface IFirebaseGCMMessage {
|
||||
gcm: {
|
||||
body: string;
|
||||
title: string;
|
||||
sound: string;
|
||||
icon: string;
|
||||
tag: string;
|
||||
color: string;
|
||||
clickAction: string;
|
||||
};
|
||||
'google.message_id': string;
|
||||
'google.sent_time': number;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface IFirebaseAPSMessage {
|
||||
aps: {
|
||||
alert: {
|
||||
title: string;
|
||||
body: string;
|
||||
};
|
||||
badge?: number;
|
||||
};
|
||||
'gcm.message_id': 'string';
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export type IFirebaseMessage = IFirebaseAPSMessage | IFirebaseGCMMessage;
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @name Firebase Messaging
|
||||
@ -36,7 +60,7 @@ export interface IFirebaseMessage {
|
||||
plugin: 'cordova-plugin-firebase-messaging',
|
||||
pluginRef: 'cordova.plugins.firebase.messaging',
|
||||
repo: 'https://github.com/chemerisuk/cordova-plugin-firebase-messaging',
|
||||
platforms: ['Android', 'iOS']
|
||||
platforms: ['Android', 'iOS'],
|
||||
})
|
||||
@Injectable()
|
||||
export class FirebaseMessaging extends IonicNativePlugin {
|
||||
|
Loading…
Reference in New Issue
Block a user