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 { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
export interface IFirebaseMessage {
|
export interface IFirebaseGCMMessage {
|
||||||
aps: any;
|
gcm: {
|
||||||
gcm: any;
|
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
|
* @beta
|
||||||
* @name Firebase Messaging
|
* @name Firebase Messaging
|
||||||
@ -36,7 +60,7 @@ export interface IFirebaseMessage {
|
|||||||
plugin: 'cordova-plugin-firebase-messaging',
|
plugin: 'cordova-plugin-firebase-messaging',
|
||||||
pluginRef: 'cordova.plugins.firebase.messaging',
|
pluginRef: 'cordova.plugins.firebase.messaging',
|
||||||
repo: 'https://github.com/chemerisuk/cordova-plugin-firebase-messaging',
|
repo: 'https://github.com/chemerisuk/cordova-plugin-firebase-messaging',
|
||||||
platforms: ['Android', 'iOS']
|
platforms: ['Android', 'iOS'],
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class FirebaseMessaging extends IonicNativePlugin {
|
export class FirebaseMessaging extends IonicNativePlugin {
|
||||||
|
Loading…
Reference in New Issue
Block a user