Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Push Notification Token Management #8

Merged
merged 11 commits into from
Aug 7, 2024
Merged

Add Push Notification Token Management #8

merged 11 commits into from
Aug 7, 2024

Conversation

hyochan
Copy link
Member

@hyochan hyochan commented Aug 7, 2024

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.

@hyochan hyochan changed the title chore: notification integration Add Push Notification Token Management Aug 7, 2024
@hyochan hyochan merged commit 3a5f219 into main Aug 7, 2024
1 check passed
@hyochan hyochan deleted the feat/notification branch August 7, 2024 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant