diff --git a/packages/firebase-admob/package.json b/packages/firebase-admob/package.json index d6880ad4..72bf81dc 100644 --- a/packages/firebase-admob/package.json +++ b/packages/firebase-admob/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/firebase-admob", - "version": "1.0.0-alpha.42", + "version": "1.0.0", "description": "NativeScript Firebase - Admob", "main": "index", "typings": "index.d.ts", diff --git a/packages/firebase-analytics/package.json b/packages/firebase-analytics/package.json index 5ef846c3..8761be18 100644 --- a/packages/firebase-analytics/package.json +++ b/packages/firebase-analytics/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/firebase-analytics", - "version": "1.0.0-alpha.42", + "version": "1.0.0", "description": "NativeScript Firebase - Analytics", "main": "index", "typings": "index.d.ts", diff --git a/packages/firebase-app-check/package.json b/packages/firebase-app-check/package.json index 50bf2b45..8d87d4f3 100644 --- a/packages/firebase-app-check/package.json +++ b/packages/firebase-app-check/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/firebase-app-check", - "version": "1.0.0-alpha.42", + "version": "1.0.0", "description": "NativeScript Firebase - App Check", "main": "index", "typings": "index.d.ts", diff --git a/packages/firebase-auth/package.json b/packages/firebase-auth/package.json index 0d9508f2..863b3946 100644 --- a/packages/firebase-auth/package.json +++ b/packages/firebase-auth/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/firebase-auth", - "version": "1.0.0-alpha.42", + "version": "1.0.0", "description": "NativeScript Firebase - Auth", "main": "index", "typings": "index.d.ts", diff --git a/packages/firebase-core/README.md b/packages/firebase-core/README.md index 4357bcf1..d31c53f6 100644 --- a/packages/firebase-core/README.md +++ b/packages/firebase-core/README.md @@ -16,7 +16,7 @@ Ensure `GoogleService-Info.plist` file located in `App_Resources/iOS`. ```ts import { firebase } from '@nativescript/firebase-core' -const defaultApp = firebase().initializeApp() +const defaultApp = await firebase().initializeApp(); ``` ### Initialize Secondary App @@ -24,7 +24,7 @@ const defaultApp = firebase().initializeApp() ```ts import { firebase, FirebaseOptions } from '@nativescript/firebase-core' const config = new FirebaseOptions() -const secondaryApp = firebase().initializeApp(config, 'SECONDARY_APP') +const secondaryApp = await firebase().initializeApp(config, 'SECONDARY_APP'); ``` diff --git a/packages/firebase-core/package.json b/packages/firebase-core/package.json index b3a77a42..5c8e61f2 100644 --- a/packages/firebase-core/package.json +++ b/packages/firebase-core/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/firebase-core", - "version": "1.0.0-alpha.42", + "version": "1.0.0", "description": "NativeScript Firebase - Core", "main": "index", "typings": "index.d.ts", diff --git a/packages/firebase-crashlytics/package.json b/packages/firebase-crashlytics/package.json index 69bf9962..de77bf06 100644 --- a/packages/firebase-crashlytics/package.json +++ b/packages/firebase-crashlytics/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/firebase-crashlytics", - "version": "1.0.0-alpha.42", + "version": "1.0.0", "description": "NativeScript Firebase - Crashlytics", "main": "index", "typings": "index.d.ts", diff --git a/packages/firebase-database/package.json b/packages/firebase-database/package.json index 750fa457..615206a3 100644 --- a/packages/firebase-database/package.json +++ b/packages/firebase-database/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/firebase-database", - "version": "1.0.0-alpha.42", + "version": "1.0.1", "description": "NativeScript Firebase - Database", "main": "index", "typings": "index.d.ts", diff --git a/packages/firebase-dynamic-links/package.json b/packages/firebase-dynamic-links/package.json index 009dbe1d..4a078dba 100644 --- a/packages/firebase-dynamic-links/package.json +++ b/packages/firebase-dynamic-links/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/firebase-dynamic-links", - "version": "1.0.0-alpha.42", + "version": "1.0.0", "description": "NativeScript Firebase - Dynamic Links", "main": "index", "typings": "index.d.ts", diff --git a/packages/firebase-firestore/package.json b/packages/firebase-firestore/package.json index 483bfb06..d5588dbb 100644 --- a/packages/firebase-firestore/package.json +++ b/packages/firebase-firestore/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/firebase-firestore", - "version": "1.0.0-alpha.42", + "version": "1.0.0", "description": "NativeScript Firebase - Firestore", "main": "index", "typings": "index.d.ts", diff --git a/packages/firebase-functions/package.json b/packages/firebase-functions/package.json index d72cca96..9be7785b 100644 --- a/packages/firebase-functions/package.json +++ b/packages/firebase-functions/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/firebase-functions", - "version": "1.0.0-alpha.42", + "version": "1.0.0", "description": "NativeScript Firebase - Functions", "main": "index", "typings": "index.d.ts", diff --git a/packages/firebase-in-app-messaging/package.json b/packages/firebase-in-app-messaging/package.json index 4068b03f..ccff9b0e 100644 --- a/packages/firebase-in-app-messaging/package.json +++ b/packages/firebase-in-app-messaging/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/firebase-in-app-messaging", - "version": "1.0.0-alpha.42", + "version": "1.0.0", "description": "NativeScript Firebase - In App Messaging", "main": "index", "typings": "index.d.ts", diff --git a/packages/firebase-installations/package.json b/packages/firebase-installations/package.json index f1049cd7..a9ff59f7 100644 --- a/packages/firebase-installations/package.json +++ b/packages/firebase-installations/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/firebase-installations", - "version": "1.0.0-alpha.42", + "version": "1.0.0", "description": "NativeScript Firebase - Installations", "main": "index", "typings": "index.d.ts", diff --git a/packages/firebase-messaging/README.md b/packages/firebase-messaging/README.md index 18f4b23e..385035c1 100644 --- a/packages/firebase-messaging/README.md +++ b/packages/firebase-messaging/README.md @@ -36,6 +36,9 @@ async function requestUserPermission() { if (enabled) { console.log('Authorization status:', authStatus); + + const didRegister = await firebase().messaging() + .registerDeviceForRemoteMessages(); } } ``` @@ -70,15 +73,14 @@ Depending on the contents of the message, it's important to understand both how The device state and message contents determines which handler will be called: -| Foreground | Background | Quit | | -| :-----------------: | :--------: | :-------------------------------------: | --------------------------------------- | -| Notification | onMessage | setBackgroundMessageHandler | setBackgroundMessageHandler | -| Notification + Data | onMessage | setBackgroundMessageHandler | setBackgroundMessageHandler | -| Data | onMessage | setBackgroundMessageHandler (see below) | setBackgroundMessageHandler (see below) | +| Foreground | Background | +| :-----------------: | :--------: | +| Notification | onMessage | +| Notification + Data | onMessage | +| Data | onMessage | - In cases where the message is data-only and the device is in the background or quit, both Android & iOS treat the message as low priority and will ignore it (i.e. no event will be sent). You can however increase the priority by setting the priority to high (Android) and content-available to true (iOS) properties on the payload. -- On iOS in cases where the message is data-only and the device is in the background or quit, the message will be delayed until the background message handler is registered via setBackgroundMessageHandler, signaling the application's javascript is loaded and ready to run. To learn more about how to send these options in your message payload, view the Firebase documentation for your [FCM API implementation](https://firebase.google.com/docs/cloud-messaging/concept-options). @@ -111,7 +113,7 @@ firebase() ### Data-only messages -When an incoming message is "data-only" (contains no notification option), both Android & iOS regard it as low priority and will prevent the application from waking (ignoring the message). To allow data-only messages to trigger the background handler, you must set the "priority" to "high" on Android, and enable the content-available flag on iOS. For example, if using the Node.js [firebase-admin](https://www.npmjs.com/package/firebase-admin) package to send a message: +When an incoming message is "data-only" (contains no notification option), both Android & iOS regard it as low priority and will prevent the application from waking (ignoring the message). To allow data-only messages to trigger , you must set the "priority" to "high" on Android, and enable the content-available flag on iOS. For example, if using the Node.js [firebase-admin](https://www.npmjs.com/package/firebase-admin) package to send a message: ```ts admin.messaging().sendToDevice( @@ -132,7 +134,7 @@ admin.messaging().sendToDevice( ); ``` -For iOS specific "data-only" messages, the message must include the appropriate APNs headers as well as the content-available flag in order to trigger the background handler. For example, if using the Node.js [firebase-admin](https://www.npmjs.com/package/firebase-admin) package to send a "data-only" message to an iOS device: +For iOS specific "data-only" messages, the message must include the appropriate APNs headers as well as the content-available flag in order to trigger the handler. For example, if using the Node.js [firebase-admin](https://www.npmjs.com/package/firebase-admin) package to send a "data-only" message to an iOS device: ```ts dmin.messaging().send({ diff --git a/packages/firebase-messaging/package.json b/packages/firebase-messaging/package.json index 724968de..3a61ca2a 100644 --- a/packages/firebase-messaging/package.json +++ b/packages/firebase-messaging/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/firebase-messaging", - "version": "1.0.0-alpha.42", + "version": "1.0.0", "description": "NativeScript Firebase - Messaging", "main": "index", "typings": "index.d.ts", diff --git a/packages/firebase-performance/package.json b/packages/firebase-performance/package.json index 620eda71..2b39ffe2 100644 --- a/packages/firebase-performance/package.json +++ b/packages/firebase-performance/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/firebase-performance", - "version": "1.0.0-alpha.42", + "version": "1.0.0", "description": "NativeScript Firebase - Performancee", "main": "index", "typings": "index.d.ts", diff --git a/packages/firebase-remote-config/package.json b/packages/firebase-remote-config/package.json index 039e1e0f..2b06d05b 100644 --- a/packages/firebase-remote-config/package.json +++ b/packages/firebase-remote-config/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/firebase-remote-config", - "version": "1.0.0-alpha.42", + "version": "1.0.0", "description": "NativeScript Firebase - Remote Config", "main": "index", "typings": "index.d.ts", diff --git a/packages/firebase-storage/package.json b/packages/firebase-storage/package.json index f3844d02..7981fc08 100644 --- a/packages/firebase-storage/package.json +++ b/packages/firebase-storage/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/firebase-storage", - "version": "1.0.0-alpha.42", + "version": "1.0.0", "description": "NativeScript Firebase - Storage", "main": "index", "typings": "index.d.ts",