Skip to content

Commit

Permalink
Merge branch 'main' of github.com:deep-foundation/firebase-push-notif…
Browse files Browse the repository at this point in the history
…ication
  • Loading branch information
FreePhoenix888 committed Aug 10, 2023
2 parents cca0d10 + e452f0b commit ae63aca
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Gitpod](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/deep-foundation/firebase-push-notification)
[![Discord](https://badgen.net/badge/icon/discord?icon=discord&label&color=purple)](https://discord.gg/deep-foundation)

Provides links for working with [`@firebase/messaging`](https://www.npmjs.com/package/@firebase/messaging) and typescript library for comfortable using of this deep package using typescript
A deep package that provides links for working with [`@firebase/messaging`](https://www.npmjs.com/package/@firebase/messaging) and typescript library for comfortable using of this deep package using typescript

# Table Of Contents
<!-- TABLE_OF_CONTENTS_START -->
Expand Down Expand Up @@ -31,7 +31,7 @@ You can find it in firebase console in settings of your project
### Web Push Certificate

- Insert [`WebPushCertificate`] with string value
You can find it in firebase console in settings of your project
You can find it in firebase console in settings of your project. You can use this url: https://console.firebase.google.com/project/PROJECT_ID/settings/serviceaccounts/adminsdk where you should change `PROJECT_ID` to your project id
- (optional) Insert [`UsesWebPushCertificate`] from `User` to [`WebPushCertificate`] to make it active
### Device
- Insert [`Device`]
Expand All @@ -40,10 +40,13 @@ This type is located in the [`@deep-foundation/capacitor-device`](https://www.np
It is recommended to use [registerDevice](https://deep-foundation.github.io/firebase-push-notification/functions/registerDevice.html) with [insertDeviceRegistrationToken](https://deep-foundation.github.io/firebase-push-notification/functions/insertDeviceRegistrationToken.html)
## Push Notification
- Insert [`PushNotification`]
- Insert any link with string value that contains title for yout push notification
You can use `SyncTextFile` from [`@deep-foundation/core`](https://www.npmjs.com/package/@deep-foundation/core) to do it.
- Insert [`PushNotification`] from [`PushNotificationTitle`] to `SyncTextFile` that contains title for push notification
- Do the above two steps for [`PushNotificationBody`] and optionally for [`PushNotificationImageUrl`], [`PushNotificationIconUrl`]
- Update its value to object like that contains `title` and `body` fields:
```json
{
"title": "My Title",
"body": "My Body"
}
```
## Notify
- Insert [`Notify`] from [`PushNotification`] to [`Device`]
- See push notification on your device :)
Expand Down

0 comments on commit ae63aca

Please sign in to comment.