You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 4, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: docs/NON_FIREBASE_MESSAGING.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,19 @@
1
-
If you read this, chances are you want Push Notifications, but don't want to use Firebase Cloud Messaging as a push provider.
1
+
If you read this, chances are you want Push Notifications, but want to use a third-party push service instead of interfacing with Firebase Cloud Messaging directly.
2
2
3
-
You'll be happy to learn this plugin has a 'lite' mode that won't add any native Firebase dependencies (or 'Pod' libraries) on iOS, and only the bare necessities on Android (on Android Push Messaging will always use FCM, regardless the push service).
3
+
You'll be 😃 to learn this plugin has a *lite* mode that won't add any native Firebase dependencies (or *Pod* libraries) on iOS, and only the bare necessities on Android (on Android, Push Messaging will always use FCM, regardless the push service).
4
4
5
-
Go to you app's root folder and remove `firebase.nativescript.json`, then `npm i`. You will now be prompted `Are you using this plugin ONLY as a Push Notification client for an external (non-Firebase) Push service? (y/n)`. Answer:
5
+
Go to you app's root folder and remove `firebase.nativescript.json`, then run `npm i`. You will be prompted `"Are you using this plugin ONLY as a Push Notification client for an external (non-Firebase) Push service? (y/n)"`. Answer:
6
6
-`y` if you don't want to use any of the Firebase features (Firestore, Realtime DB, Storage, etc), or
7
7
-`n` in case you do want to use some of the features (you will be asked which features later).
8
8
9
-
The remainder of this document applies to both situations, so please continue reading.
9
+
> The remainder of this document applies to both situations, so please continue reading.
10
10
11
11
## Demo app
12
12
I've tried applying best practices to a [dedicated push-only demo app](/demo-push).
13
13
14
14
Two important things to keep in mind are:
15
-
-`require` (not `import`!) the plugin in [app/app.ts](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/e18e546ac1b96fea1d7ce71c5ae3453a8955cc17/demo-push/app/app.ts#L5).
16
-
- Show [your own consent screen](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/e18e546ac1b96fea1d7ce71c5ae3453a8955cc17/demo-push/app/push-view-model.ts#L33-L43) before iOS requests permission, because a) the default popup (that'll also still be shown) isn't very friendly/configurable, and b) once the user denies permission they have to go to the settings app as you app can only request permission once.
15
+
-`require` (not `import`!) the plugin in [app/app.ts](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/e18e546ac1b96fea1d7ce71c5ae3453a8955cc17/demo-push/app/app.ts#L5) (or `main.ts`, or any other file that bootstraps your app).
16
+
- Show [your own consent screen](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/e18e546ac1b96fea1d7ce71c5ae3453a8955cc17/demo-push/app/push-view-model.ts#L33-L43) before iOS requests permission, because **a)** the default popup (that'll also still be shown) isn't very friendly/configurable, and **b)** once the user denies permission they have to go to the settings app as you app can only request permission once.
17
17
18
18
## Setup
19
19
@@ -27,6 +27,7 @@ There is a little quirk: you will currently not get the title and body if the no
27
27
#### Enable push support in Xcode
28
28
29
29
Open /platforms/ios/yourproject.__xcworkspace__ (!) and go to your project's target and head over to "Capabilities" to switch this on (if it isn't already):
For testing on Android I prefer using [Postman](https://www.getpostman.com/). Look at which headers you need to set, and how the payload needs to be added:
209
+
For testing on Android I prefer using [Postman](https://www.getpostman.com/) to *POST* to the FCM REST API. Look at which headers you need to set, and how the payload needs to be added:
0 commit comments