0.1.3 • Published 2 years ago

strapi-fcm v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Strapi FCM

Send push cloud notifications to your userbase

npm.io

Installation

$ npm install strapi-fcm
$ yarn add strapi-fcm

Demo Video Playlist

Demo Video Playlist

Steps

  1. Create a new project

Create a new project and add strapi-fcm to your project.

  1. Add the plugin to your project

To get started, read the getting started guide. then for a example project click on dimo links for some important documentations click docs links.

npm.io 3. Configure API keys and Admin SDK at /settings/strapi-fcm

To configure Cloudinary API keys and Admin SDK, go to the settings page and click on the Strapi FCM tab. there will be links for firebase docs and cloudinary docs. You can follow those guidelines to configure your keys.

npm.io 4. Send notification tokens to backend from the fontend using the /strapi-fcm/users/tokens endpoint

To configure the font-end use this snippit or use your own snippit for saving fcm tokens to back-end database please use the following api endpoint https://server/strapi-fcm/users/tokens. To get notification tokens must be sent to back-end.

useEffect(() => {
  try {
    getToken(messaging)
      .then(async (token) => {
        if (token) {
          axios
            .post(`${SERVER}/strapi-fcm/users/tokens`, {
              token: token,
            })
            .then((res) => {
              // Handle success
            });
        } else {
          Push.Permission.request(
            () => {
              // User has granted permission
            },
            () => {
              // User has denied permission
            }
          );
        }
      })
      .catch(() => {});
  } catch (error) {
    // Handle error
  }
}, []);
  1. Go to /admin/plugins/strapi-fcm

You can see the full dashboard for the plugin. There are two tabs such as Send and Sent.

  1. Send a notification to your userbase

To send a cloud notification to userbase, go and fill the title field and body field image is not compulsory but if you want to send an image then you can upload it. Then click on send button.

npm.io

  1. See previous notifications in your userbase by clicking on the sent tab

To see your previous notifications, click on the sent tab. Then you can see the notifications sent to your userbase.

npm.io

  1. Enjoy your cloud notifications

You can enjoy your cloud notifications by testing it in the browser.

npm.io

  1. Send a notification from your blog post

You also can send a notification from your blog post. Its on your blog post page. You can selectet which field you want to send as the title and body. Its easy to send a notification from your blog post.

npm.io

  1. Update your credentials at /settings/strapi-fcm

To update your credentials, go to the settings page and click on the Strapi FCM tab. You can update your credentials here.

npm.io

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.1.0

2 years ago

0.0.0

2 years ago