Send data from your server to your users.
Push notifications live at the core of Electrolytic. In fact, it was the primary motivation for us to build Electrolytic because we could not find any reliable and easy-to-use solution anywhere.
Push works similar to how you may have already used in Firebase/FCM or iOS push notifications. Here's a super-simple overview:
token to your app.token to your server.token against John's record in database.payload to that token.payload it received in the notification.Once you have installed the package, you can start to listen on the token event emitted by the electrolytic instance.
electrolytic.on('token', (token) => {
console.log('got a token', token)
})
A new token is generated on app's launch and also when the app reconnects to the Electrolytic's servers due to any network issues, etc. So it is very important that you listen to this event and report the token to your servers everytime it's provided.
electrolytic.on('push', (payload) => {
console.log('got a push', payload)
})
When a push notification is sent via the server or from the dashboard, the SDK will emit push event. The payload sent via push will be provided as-is.
For any issues, suggestions or questions regarding the docs, please use this repo.