Skip to content

Commit

Permalink
chore: release v1
Browse files Browse the repository at this point in the history
  • Loading branch information
triniwiz committed Mar 8, 2022
1 parent 2dd3032 commit dc3fd90
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion packages/firebase-admob/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase-analytics/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase-app-check/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase-auth/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/firebase-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ 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

```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');
```


Expand Down
2 changes: 1 addition & 1 deletion packages/firebase-core/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase-crashlytics/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase-database/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase-dynamic-links/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase-firestore/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase-functions/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase-in-app-messaging/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase-installations/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
18 changes: 10 additions & 8 deletions packages/firebase-messaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ async function requestUserPermission() {

if (enabled) {
console.log('Authorization status:', authStatus);

const didRegister = await firebase().messaging()
.registerDeviceForRemoteMessages();
}
}
```
Expand Down Expand Up @@ -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).

Expand Down Expand Up @@ -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(
Expand All @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase-messaging/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase-performance/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase-remote-config/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase-storage/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit dc3fd90

Please sign in to comment.