Solved

Update push token from client

  • 15 February 2023
  • 4 replies
  • 335 views

Badge +1

We see that Klaviyo allows to store and query a specific property called `push_token` inside a profile, however we can’t seem to be able to update this property say from a client device that accepted notifications. 

 

Currently we solve this issue by setting a custom attribute when sending the client update profile event. Is there a cleaner way to do this or will this be considered for a future API release?

icon

Best answer by markpiana 3 August 2023, 16:52

View original

4 replies

Userlevel 5
Badge +15

Hey @ocastx! Happy to help!
 

Klaviyo's push notification functionality is designed to allow you to send push notifications to your customers, but it does not provide a way to capture or store a device's push token directly.

To update the push_token property for a profile, you will need to send a profile update event to Klaviyo with the updated push_token property value.

One option for capturing and updating push tokens is to use a mobile analytics or engagement platform that provides native support for push notifications and integrates with Klaviyo. For example, if you're using a mobile app, you might use a platform like Braze, Leanplum, or Iterable to capture the push token and then use their Klaviyo integrations to pass that data into Klaviyo.

Alternatively, you can continue to set a custom attribute on the profile when sending the client update profile event. This approach works well if you are already sending profile update events for other reasons, but it may not be the most efficient or scalable approach if you are only updating the push token property.

In terms of future API releases, I would recommend submitting a feature request to Klaviyo's support team if you'd like to see more direct support for push tokens in the Klaviyo API. They may be able to provide more information on whether this feature is planned or under consideration for future releases.

Userlevel 3
Badge +4

Hi @ocastx !

Klaviyo now has a client endpoint specifically for creating and updating push tokens - https://developers.klaviyo.com/en/reference/create_client_push_token. This endpoint is the only way to add or update push tokens.

The previous answer will NOT work for actually sending push notifications. It is possible to create a profile property for push tokens and store tokens there; however, Klaviyo will not use that profile property when actually attempting to send notifications.

Thanks,

Mark

Badge

Hi @Mark 

Can you please look into this issue also

I have pushed the FCM token generated by the iOS app to Klaviyo. But when I see in my profile in Klaviyo and copy that token and try to send preview it says invalid token. although if I try to send and use the same token on FCM to works fine and notifications shows up in iPhone. what could be the reason that Klaviyo is not able to recognise the push token sent from iOS app

Userlevel 7
Badge +35

 HI @Richa Gupta!

I would actually recommend reaching out to Support for this issue since it can be highly-account specific. 

 

- Brian

Reply