Skip to content

Commit

Permalink
[test] configure notification settings to debug on testflight.
Browse files Browse the repository at this point in the history
  • Loading branch information
ronniebeggs committed Apr 25, 2024
1 parent 1048986 commit 0cf45cb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
26 changes: 26 additions & 0 deletions src/app/(BottomTabNavigation)/AllCases/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function CasesScreen() {

const { allCases, loading } = useContext(CaseContext);
const { session } = useSession();
const [notificationResponse, setNotificationResponse] = useState<string>('');

const [url, setUrl] = useState<Linking.ParsedURL | null>(null);

Expand Down Expand Up @@ -86,12 +87,36 @@ function CasesScreen() {
notificationListener.current =
Notifications.addNotificationReceivedListener(notification => {
const updateId = notification.request.content.data['id'];
const debugString =
'NotificationRecieved: ' +
notification +
', ' +
notification.request +
', ' +
notification.request.content +
', ' +
notification.request.content.data;
console.log(debugString);
setNotificationResponse(debugString);
router.push(`/AllCases/Updates/UpdateView/${updateId}`);
});

responseListener.current =
Notifications.addNotificationResponseReceivedListener(response => {
const updateId = response.notification.request.content.data['id'];
const debugString =
'NotificationResponseRecieved: ' +
response +
', ' +
response.notification +
', ' +
response.notification.request +
', ' +
response.notification.request.content +
', ' +
response.notification.request.content.data;
console.log(debugString);
setNotificationResponse(debugString);
router.push(`/AllCases/Updates/UpdateView/${updateId}`);
});

Expand All @@ -115,6 +140,7 @@ function CasesScreen() {
ListHeaderComponent={() => (
<>
<View style={styles.headerContainer}>
<Text>{notificationResponse}</Text>
<Text style={styles.titleText}>My Cases</Text>
</View>
</>
Expand Down
5 changes: 0 additions & 5 deletions supabase/functions/push/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ Deno.serve(async req => {
title: category,
body: update,
data: { updateId: updateId },
// data: [
// {
// updateId: updateId,
// },
// ],
}),
}).then(res => res.json());

Expand Down

0 comments on commit 0cf45cb

Please sign in to comment.