From 5b8afe964565fddc6c56a03eb485c1118b67a647 Mon Sep 17 00:00:00 2001 From: ami-aman <91549653+ami-aman@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:53:15 +0530 Subject: [PATCH] js fixes --- Apps/APN/src/screens/Dashboard.js | 14 +++++++------- Apps/APN/src/services/CustomerIOService.js | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Apps/APN/src/screens/Dashboard.js b/Apps/APN/src/screens/Dashboard.js index db5534ac..4aa5cfbd 100644 --- a/Apps/APN/src/screens/Dashboard.js +++ b/Apps/APN/src/screens/Dashboard.js @@ -1,4 +1,4 @@ -import { PushPermissionStatus } from 'customerio-reactnative'; +import { CioPushPermissionStatus } from 'customerio-reactnative'; import React from 'react'; import { Image, @@ -68,15 +68,15 @@ const Dashboard = ({ navigation }) => { const handlePushPermissionCheck = () => { getPushPermissionStatus().then((status) => { switch (status) { - case PushPermissionStatus.Granted: + case CioPushPermissionStatus.Granted: Prompts.showAlert({ title: pushPermissionAlertTitle, message: 'Push notifications are enabled on this device', }); break; - case PushPermissionStatus.Denied: - case PushPermissionStatus.NotDetermined: + case CioPushPermissionStatus.Denied: + case CioPushPermissionStatus.NotDetermined: requestPushPermission(); break; } @@ -89,14 +89,14 @@ const Dashboard = ({ navigation }) => { requestPushNotificationsPermission(options) .then((status) => { switch (status) { - case PushPermissionStatus.Granted: + case CioPushPermissionStatus.Granted: Prompts.showSnackbar({ text: 'Push notifications are now enabled on this device', }); break; - case PushPermissionStatus.Denied: - case PushPermissionStatus.NotDetermined: + case CioPushPermissionStatus.Denied: + case CioPushPermissionStatus.NotDetermined: Prompts.showAlert({ title: pushPermissionAlertTitle, message: diff --git a/Apps/APN/src/services/CustomerIOService.js b/Apps/APN/src/services/CustomerIOService.js index b49d9e8b..2a151f9f 100644 --- a/Apps/APN/src/services/CustomerIOService.js +++ b/Apps/APN/src/services/CustomerIOService.js @@ -54,12 +54,12 @@ export const trackProfileAttribute = (name, value) => { CustomerIO.setProfileAttributes(data); }; -export const getPushPermissionStatus = () => { - return CustomerIO.getPushPermissionStatus(); +export const getPushPermissionStatus = async() => { + return CustomerIO.pushMessaging.getPushPermissionStatus(); }; export const requestPushNotificationsPermission = (options) => { - return CustomerIO.showPromptForPushNotifications(options); + return CustomerIO.pushMessaging.showPromptForPushNotifications(options); }; // TODO: Implement this method when inapp feature is added