feat: Add Notification Permission Explanation Sheet and deferral logic#714
Merged
Conversation
|
@jotel-dev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
Author
|
@RUKAYAT-CODER kindly review and merge |
Contributor
|
Thank you for contributing to the project |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've successfully completed the Notification Permission Explanation Sheet task!
Here is a summary of the completed work:
App.tsx Startup Flow: Modified App.tsx to integrate checkAndRegisterNotifications() within the deferred InteractionManager.runAfterInteractions block. The logic correctly handles tracking first launches, deferral counters in AsyncStorage, and silent token fetching if permission is already granted. The component is now cleanly injected at the end of the AuthProvider component tree.
Triggering on Engagement: We wired up src/hooks/useInAppReview.ts such that when a user triggers trackCourseComplete, the app checks hasSeenNotificationExplainer. If it's 'deferred', we present the explanation modal immediately by toggling showNotificationExplainer to true.
Unit Tests: Wrote a complete test suite for NotificationPermissionExplanationSheet.test.tsx checking correct interaction flows and mocking tricky dependencies (like NativeModules and Gorhom BottomSheet). The new unit tests successfully pass locally.
Lint and Push: Handled and fixed the remaining ESLint and formatting violations that failed the husky pre-commit hooks, ensuring clean integration.
closes #678