Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit d29752f

Browse files
doc++
1 parent aeae486 commit d29752f

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

docs/NON_FIREBASE_MESSAGING.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff 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.
22

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).
44

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:
66
- `y` if you don't want to use any of the Firebase features (Firestore, Realtime DB, Storage, etc), or
77
- `n` in case you do want to use some of the features (you will be asked which features later).
88

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.
1010
1111
## Demo app
1212
I've tried applying best practices to a [dedicated push-only demo app](/demo-push).
1313

1414
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.
1717

1818
## Setup
1919

@@ -27,6 +27,7 @@ There is a little quirk: you will currently not get the title and body if the no
2727
#### Enable push support in Xcode
2828

2929
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):
30+
3031
<img src="images/push-xcode-config.png" width="600px" alt="Push Xcode config"/>
3132

3233
> Without this enabled you will receive push messages in the foreground, but **NOT in the background** / when the app is killed.
@@ -205,6 +206,6 @@ For testing notifications on iOS the easiest tool I found is [Pusher](https://gi
205206
<img src="images/messaging/pusher.png" width="712px" alt="Pusher"/>
206207

207208
### Android
208-
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:
209210

210-
<img src="images/messaging/postman-headers.png" width="480px" alt="Postman headers"/> <img src="images/messaging/postman-body.png" width="480px" alt="Postman body"/>
211+
<img src="images/messaging/postman-headers.png" width="450px" alt="Postman headers"/> <img src="images/messaging/postman-payload.png" width="450px" alt="Postman body"/>

0 commit comments

Comments
 (0)