[messaging] Update typescript definition to match interface changes
This commit is contained in:
parent
02be8a0d84
commit
782958d026
|
@ -77,18 +77,18 @@ dependencies {
|
|||
compile(project(':react-native-firebase')) {
|
||||
transitive = false
|
||||
}
|
||||
compile "com.google.firebase:firebase-core:10.2.6"
|
||||
compile "com.google.firebase:firebase-core:11.0.0"
|
||||
|
||||
# RNFirebase optional dependencies
|
||||
compile "com.google.firebase:firebase-ads:10.2.6"
|
||||
compile "com.google.firebase:firebase-analytics:10.2.6"
|
||||
compile "com.google.firebase:firebase-auth:10.2.6"
|
||||
compile "com.google.firebase:firebase-config:10.2.6"
|
||||
compile "com.google.firebase:firebase-crash:10.2.6"
|
||||
compile "com.google.firebase:firebase-database:10.2.6"
|
||||
compile "com.google.firebase:firebase-messaging:10.2.6"
|
||||
compile "com.google.firebase:firebase-perf:10.2.6"
|
||||
compile "com.google.firebase:firebase-storage:10.2.6"
|
||||
compile "com.google.firebase:firebase-ads:11.0.0"
|
||||
compile "com.google.firebase:firebase-analytics:11.0.0"
|
||||
compile "com.google.firebase:firebase-auth:11.0.0"
|
||||
compile "com.google.firebase:firebase-config:11.0.0"
|
||||
compile "com.google.firebase:firebase-crash:11.0.0"
|
||||
compile "com.google.firebase:firebase-database:11.0.0"
|
||||
compile "com.google.firebase:firebase-messaging:11.0.0"
|
||||
compile "com.google.firebase:firebase-perf:11.0.0"
|
||||
compile "com.google.firebase:firebase-storage:11.0.0"
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -175,6 +175,6 @@ In the same file, add the `firebase-perf` module to your dependencies:
|
|||
```
|
||||
dependencies {
|
||||
...
|
||||
compile "com.google.firebase:firebase-perf:10.2.6"
|
||||
compile "com.google.firebase:firebase-perf:11.0.0"
|
||||
}
|
||||
```
|
||||
|
|
|
@ -573,14 +573,14 @@ declare module "react-native-firebase" {
|
|||
* On the event a devices FCM token is refreshed by Google,
|
||||
* the new token is returned in a callback listener.
|
||||
*/
|
||||
onTokenRefresh(listener: (token: string) => any): void
|
||||
onTokenRefresh(listener: (token: string) => any): () => any
|
||||
/**
|
||||
* On a new message,
|
||||
* the payload object is passed to the listener callback.
|
||||
* This method is only triggered when the app is running.
|
||||
* Use getInitialNotification for notifications which cause the app to open.
|
||||
*/
|
||||
onMessage(listener: (message: any) => any): void
|
||||
onMessage(listener: (message: any) => any): () => any
|
||||
/**
|
||||
* Create a local notification from the device itself.
|
||||
*/
|
||||
|
|
|
@ -203,7 +203,7 @@ export default class Messaging extends Base {
|
|||
* @param listener
|
||||
* @returns {*}
|
||||
*/
|
||||
onMessage(listener: Function) {
|
||||
onMessage(listener: Function): () => any {
|
||||
return FirebaseMessagingEvt.addListener(
|
||||
EVENT_TYPE.Notification,
|
||||
async(event) => {
|
||||
|
@ -225,7 +225,7 @@ export default class Messaging extends Base {
|
|||
* @param listener
|
||||
* @returns {*}
|
||||
*/
|
||||
onTokenRefresh(listener: Function) {
|
||||
onTokenRefresh(listener: Function): () => any {
|
||||
return FirebaseMessagingEvt.addListener(EVENT_TYPE.RefreshToken, listener).remove;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue