Show Developer Menu

Custom Push Tokens

Introduction

Re:amaze Push Campaigns by default save a website visitor's vapid token using our internal push keys. If you have collected vapid tokens for customers using your own push keys, you can manually override website visitors' push tokens so that we use your tokens during the sending of Push Campaigns. You can manually set a customer's push token by passing in the stringified token into the _support variable.

<script type="text/javascript">
  var _support = _support || { 'ui': {}, 'user': {} };
  _support.ui = _support.ui || {};
  _support.ui.pushNotifications = {
    subscribed: true,
    customVapidtoken: "{\"endpoint\":\"https://fcm.googleapis.com/fcm/send/abc\",\"expirationTime\":null,\"keys\":{\"p256dh\":\"def\",\"auth\":\"ghi\"}}"
  }
</script>
Parameter Description
subscribed By default, we will send to any vapid token that is set on a customer. You can override this behavior by passing in a false
customVapidtoken Stringified vapid token for the user. If this token is invalid, the token will be deleted when a new Push Campaign attempts to send to this token.

Note: If you are manually setting push keys, you will need to input your Public and Private Application Server Keys in Settings > Push Keys.