Skip to content

Commit

Permalink
js fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ami-aman committed Sep 19, 2024
1 parent 5d63d5d commit 5b8afe9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions Apps/APN/src/screens/Dashboard.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PushPermissionStatus } from 'customerio-reactnative';
import { CioPushPermissionStatus } from 'customerio-reactnative';
import React from 'react';
import {
Image,
Expand Down Expand Up @@ -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;
}
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions Apps/APN/src/services/CustomerIOService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5b8afe9

Please sign in to comment.