Skip to main content
Solved

HELP with push notification

  • February 27, 2025
  • 3 replies
  • 43 views

Forum|alt.badge.img
Klaviyo.instance.initialize('Added My Private Api key here');

 

Created Service account and enabled the Andorid Push Notification and tried to fetch how many people can receive push notification but there i didn't get any number of people 

No profile in included groups have a push token.   

after that i tried to  Schedule or send campaign i got the above message. 

and my recipient number is also 0  Please Guide me How can i Solve this

Best answer by MANSIR2094

 

Hey ​@Rushikesh_157 ,

I think I know what might be going on. Since you're testing on real devices with notifications turned on, it's possible that Klaviyo isn't getting the push tokens right.

Let's make sure everything is set up correctly. Have you double-checked that Firebase is fully set up and linked to Klaviyo? This is especially important if you're testing on iOS.

Try getting the push token manually and sending it to Klaviyo. You can do this using:

`FirebaseMessaging.instance.getToken().then((token) { if (token != null) { Klaviyo.instance.setPushToken(token); } });`

Also, check if any profiles in Klaviyo have a push token. If not, Klaviyo won't recognize any users as subscribed.

To see if Firebase is generating a token, add a log:

`FirebaseMessaging.instance.getToken().then((token) { print("Push Token: $token"); });`

If no token shows up, Firebase might not be working correctly. If the token appears but Klaviyo still isn't detecting it, check Klaviyo's API logs for any errors.

Let me know what happens, and we'll tackle this further together!

View original
Did this topic or the replies in the thread help you find an answer to your question?

3 replies

MANSIR2094
Problem Solver IV
Forum|alt.badge.img+17
  • Problem Solver IV
  • 262 replies
  • February 28, 2025

Hi ​@Rushikesh_157 , 

Klaviyo isn’t detecting any push tokens, which means no users have opted in for push notifications. Make sure your app asks for push notification permission and users accept it. Users also need to open the app at least once after installing it for Klaviyo to register their device. Check Klaviyo to see if any profiles have a push token. If not, no users are subscribed yet. Push notifications won’t work on simulators, so test on a real device. If the issue persists, try manually adding a test device to see if it gets registered.


Forum|alt.badge.img
  • Author
  • Contributor I
  • 1 reply
  • March 2, 2025

Hi ​@MANSIR2094, I tested on real devices And turned on the Notifications also. I tried with Both Api Public & Private. Still not getting user details in dashboard. I’m using Flutters package klaviyo_flutter: ^0.1.4

import 'package:klaviyo_flutter/klaviyo_flutter.dart';
void main() async {  WidgetsFlutterBinding.ensureInitialized();  await Firebase.initializeApp(); // Ensure Firebase is properly initialized  // Initialize Klaviyo  Klaviyo.instance.initialize('ABCDEF');  runApp(const MyApp());}

 


MANSIR2094
Problem Solver IV
Forum|alt.badge.img+17
  • Problem Solver IV
  • 262 replies
  • Answer
  • March 2, 2025

 

Hey ​@Rushikesh_157 ,

I think I know what might be going on. Since you're testing on real devices with notifications turned on, it's possible that Klaviyo isn't getting the push tokens right.

Let's make sure everything is set up correctly. Have you double-checked that Firebase is fully set up and linked to Klaviyo? This is especially important if you're testing on iOS.

Try getting the push token manually and sending it to Klaviyo. You can do this using:

`FirebaseMessaging.instance.getToken().then((token) { if (token != null) { Klaviyo.instance.setPushToken(token); } });`

Also, check if any profiles in Klaviyo have a push token. If not, Klaviyo won't recognize any users as subscribed.

To see if Firebase is generating a token, add a log:

`FirebaseMessaging.instance.getToken().then((token) { print("Push Token: $token"); });`

If no token shows up, Firebase might not be working correctly. If the token appears but Klaviyo still isn't detecting it, check Klaviyo's API logs for any errors.

Let me know what happens, and we'll tackle this further together!