Open abubakarflutter opened 10 months ago
Hello, try adding this code to firebaseMessagingBackgroundHandler
:
final data = message.data;
final klaviyo = Klaviyo.instance;
if (klaviyo.isKlaviyoPush(data)) {
if (!klaviyo.isInitialized) {
await klaviyo.initialize(KLAVIYO_TOKEN);
}
final result = await klaviyo.handlePush(data);
}
Hello, try adding this code to
firebaseMessagingBackgroundHandler
:final data = message.data; final klaviyo = Klaviyo.instance; if (klaviyo.isKlaviyoPush(data)) { if (!klaviyo.isInitialized) { await klaviyo.initialize(KLAVIYO_TOKEN); } final result = await klaviyo.handlePush(data); }
klaviyo.initialize will have the API KEY not the klaviyo token, token is something that is related to FCM or APN
Additionally, where to listen the notification and trigger the local_push_notification function to actually show the notification in the mobile app? I am unable to get it, like where we are listening the klaviyo notifications?
moreover the method >handlePush will only return bool , how this will trigger the show notification function?
Any update
Hello, try adding this code to
firebaseMessagingBackgroundHandler
:final data = message.data; final klaviyo = Klaviyo.instance; if (klaviyo.isKlaviyoPush(data)) { if (!klaviyo.isInitialized) { await klaviyo.initialize(KLAVIYO_TOKEN); } final result = await klaviyo.handlePush(data); }
Any thoughts? waiting for your answer
i am unable to get push notification in my IOS real device in using Klaviyo i don't know why i am getting the following error that "handleBackgroundMessage" can't be found, moreover, where to listen the notification and how to show that. no proper steps has been defined. Please help