-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Push Notification Token Management (#8)
# Add Notification Permission and Push Token Management ## Description Implemented notification permission handling using `expo-notifications`. The app now checks for and requests notification permissions on launch and when the app becomes active. Additionally, implemented push notification token handling using Supabase. Tokens are registered on login and deleted on logout. ## Changes ### Notification Permissions - Integrated `expo-notifications` to manage notification permissions. - Added permission check on app launch. - Re-checked permissions when the app becomes active using `AppState`. - Configured `LSApplicationQueriesSchemes` for `mailto:` in `app.json`. ### Push Token Management - Added functions for push token management in Supabase: - `fetchAddPushToken`: Adds or retrieves an existing push token. - `fetchDeletePushToken`: Deletes a push token. - `fetchPushTokens`: Fetches all push tokens for a user. - Integrated token registration on login and deletion on logout in the app's layout. ## How to Test 1. **Notification Permissions**: - Verify that the app requests notification permissions on launch. - Note that user should be signed-in. - Move the app to the background and back to the foreground to ensure permissions are re-checked. 2. **Push Token Management**: - **Login**: - Verify the token is added to the `push_tokens` table in Supabase. - **Logout**: - Verify the token is removed from the `push_tokens` table in Supabase.
- Loading branch information
Showing
29 changed files
with
1,216 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.