Solved

Hybrid - Push notification Not Working in Production

  • 14 November 2023
  • 10 replies
  • 229 views

Badge +1

Hi, we have a hybrid application - Ionic React from which i wanted to implement Klaviyo push notification. 

Take note, push notification is already working on our app and i just want to add klaviyo push notification without using the SDK. 

These are the steps i did to make it work:
1. Get permission (Done already as we can receive our own push notification)
2. Create or Update Push token (Done Via - https://developers.klaviyo.com/en/reference/create_client_push_token)
     - Ive used platform = ios and, vendor = FCM as we’re using Firebase to make our push notif work. 

Result: Mobile push notifications enabled on a user profile. And user can be added in a segment where filter is all users that can receive push notification.

Issue: I keep getting Bounced Push, with error: 

The specified device token was bad. Verify that the request contains a valid token and that the token matches the environment.

Error Name: BadDeviceToken

Even though its the same token we’re using in our project and it works on our end. 

 

icon

Best answer by markpiana 16 November 2023, 15:59

View original

10 replies

Userlevel 3
Badge +4

Hi @jemantilla ,

Klaviyo does not currently support sending iOS push notifications through FCM. All iOS push notifications are routed through APNs. Therefore, when you try to send to an iOS device using an FCM token, APNs flags the token as invalid, and Klaviyo removes the token from the profile.

To send push notifications to iOS devices, you will need to follow the steps in our guide for setting up iOS push notifications, including uploading your APNs authentication key in your Klaviyo account settings. Plus, when you send iOS tokens to Klaviyo via the API, you will need to set the vendor to APNs. 

I hope that helps!

 

Thanks,

Mark

Badge +1

Hi @jemantilla ,

Klaviyo does not currently support sending iOS push notifications through FCM. All iOS push notifications are routed through APNs. Therefore, when you try to send to an iOS device using an FCM token, APNs flags the token as invalid, and Klaviyo removes the token from the profile.

To send push notifications to iOS devices, you will need to follow the steps in our guide for setting up iOS push notifications, including uploading your APNs authentication key in your Klaviyo account settings. Plus, when you send iOS tokens to Klaviyo via the API, you will need to set the vendor to APNs. 

I hope that helps!

 

Thanks,

Mark

Hello, so i’ve tried that. I’m still getting BadDeviceToken on ios. For android it says “Received Push” but i actually don’t receive anything on my app. Anything else i need to consider? 

Userlevel 3
Badge +4

Just to confirm, are you using an APNs token for iOS and still getting that error? If you’re using an FCM token, that won’t work. If you are using an APNs token, make sure that you are using a token for the correct environment. If your app is in production (i.e., in the App Store or TestFlight), you have to use a production token. If you’re using a debug build, you should use a sandbox token. 

Badge +1

Yes, I’ve done that. I know its the right token cause it’s the same token we use to send push notif and our push notif works so it’s quite weird that its not working now. To give more context we use FCM on our app to receive push notifications but for token in IOS we use APNs. 

Also it’s deployed in production.

Userlevel 3
Badge +4

Just confirming again, have you updated the tokens in Klaviyo to be platform = ios and vendor = apns?

Badge +1

Yes, it’s “ios” and “APNs”

Badge +1

I also tried using both FCM token and APNs token with vendor being “APNs” and platform “ios”. Both are not working on our production.

Preceding steps was:
1. Get push notification permission
2. Setup FCM configuration in ios and android to use files from Firebase for push notification. 
3. Uploaded APN authentication key in ios settings.
4. APN auth key on our firebase is the same key i’ve uploaded

Badge +1

-

Userlevel 3
Badge +4

Since sending to iOS through FCM is not currently supported, my hunch is that that is the cause of the issue somehow, but it is hard to troubleshoot this problem without more specific information about your account. If you haven’t yet, I would recommend creating a Klaviyo Support ticket, so we can take a look at your account and more thoroughly help you triage this issue. https://www.klaviyo.com/support

Badge +1

Thank you!

Reply