2
0
mirror of synced 2025-01-12 07:04:21 +00:00

[messaging] Update typescript definition to match interface changes

This commit is contained in:
Chris Bianca 2017-06-19 12:25:58 +01:00
parent 02be8a0d84
commit 782958d026
3 changed files with 66 additions and 66 deletions

View File

@ -77,18 +77,18 @@ dependencies {
compile(project(':react-native-firebase')) { compile(project(':react-native-firebase')) {
transitive = false transitive = false
} }
compile "com.google.firebase:firebase-core:10.2.6" compile "com.google.firebase:firebase-core:11.0.0"
# RNFirebase optional dependencies # RNFirebase optional dependencies
compile "com.google.firebase:firebase-ads:10.2.6" compile "com.google.firebase:firebase-ads:11.0.0"
compile "com.google.firebase:firebase-analytics:10.2.6" compile "com.google.firebase:firebase-analytics:11.0.0"
compile "com.google.firebase:firebase-auth:10.2.6" compile "com.google.firebase:firebase-auth:11.0.0"
compile "com.google.firebase:firebase-config:10.2.6" compile "com.google.firebase:firebase-config:11.0.0"
compile "com.google.firebase:firebase-crash:10.2.6" compile "com.google.firebase:firebase-crash:11.0.0"
compile "com.google.firebase:firebase-database:10.2.6" compile "com.google.firebase:firebase-database:11.0.0"
compile "com.google.firebase:firebase-messaging:10.2.6" compile "com.google.firebase:firebase-messaging:11.0.0"
compile "com.google.firebase:firebase-perf:10.2.6" compile "com.google.firebase:firebase-perf:11.0.0"
compile "com.google.firebase:firebase-storage:10.2.6" 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 { dependencies {
... ...
compile "com.google.firebase:firebase-perf:10.2.6" compile "com.google.firebase:firebase-perf:11.0.0"
} }
``` ```

4
index.d.ts vendored
View File

@ -573,14 +573,14 @@ declare module "react-native-firebase" {
* On the event a devices FCM token is refreshed by Google, * On the event a devices FCM token is refreshed by Google,
* the new token is returned in a callback listener. * 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, * On a new message,
* the payload object is passed to the listener callback. * the payload object is passed to the listener callback.
* This method is only triggered when the app is running. * This method is only triggered when the app is running.
* Use getInitialNotification for notifications which cause the app to open. * 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. * Create a local notification from the device itself.
*/ */

View File

@ -203,7 +203,7 @@ export default class Messaging extends Base {
* @param listener * @param listener
* @returns {*} * @returns {*}
*/ */
onMessage(listener: Function) { onMessage(listener: Function): () => any {
return FirebaseMessagingEvt.addListener( return FirebaseMessagingEvt.addListener(
EVENT_TYPE.Notification, EVENT_TYPE.Notification,
async(event) => { async(event) => {
@ -225,7 +225,7 @@ export default class Messaging extends Base {
* @param listener * @param listener
* @returns {*} * @returns {*}
*/ */
onTokenRefresh(listener: Function) { onTokenRefresh(listener: Function): () => any {
return FirebaseMessagingEvt.addListener(EVENT_TYPE.RefreshToken, listener).remove; return FirebaseMessagingEvt.addListener(EVENT_TYPE.RefreshToken, listener).remove;
} }