Comment on page
If you purchased a Gravity Native or Gravity Power plan, you can send push notifications from the server to mobile devices on iOS or Android.
When a user provides permission in-app to send push notifications, a push token for their device is stored in the database.
To send a notification, simple call the send method of the notification helper and pass an array of tokens, plus the message you want to send.
const notification = require('./helper/notification')
const tokens = ['wX1JVaQrCXOdTgAHa3FP', 'bXzeupkfVIKlrIKwtOH2']
title: 'New User',
body: 'A new user has just signed up to your app',
Failing to stop sending notifications to an unregistered device may result in being banned from sending push notifications by Apple and/or Google.
If a user disables push notifications for your service at any point, Gravity will remove the device token from the database the next time you attempt to send a notification and there is a