feat: subscribeTo and subscribeFrom push notifications#276
Conversation
| /dist | ||
| /coverage No newline at end of file | ||
| /coverage | ||
| CHANGELOG.md No newline at end of file |
There was a problem hiding this comment.
CHANGELOG.md is autogenerated by a workflow and sometimes it doesn't comply with Prettier rules, in fact it is failing in master right now. I'm excluding it from Prettier execution but another solution would be to execute yarn --prettier -w CHANGELOG.md after updating it. WDYT?
There was a problem hiding this comment.
Being autogenerated I think it's cool to ignore it
There was a problem hiding this comment.
Pull request overview
Adds a new WebView Bridge API surface for initiating push-notification subscription/unsubscription flows from web code, backing it with new bridge message types, documentation, and tests, as requested in issue #275.
Changes:
- Introduces
subscribeToPushNotifications()/unsubscribeFromPushNotifications()web APIs that call the native bridge withSUBSCRIBE_TO_PUSH_NOTIFICATIONS/UNSUBSCRIBE_FROM_PUSH_NOTIFICATIONS. - Extends
ResponsesFromNativeApptyping to include the two new message types. - Adds Jest tests and README docs for the new APIs; exports them from the package entrypoint.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/push-notifications.ts | Adds the new push subscription/unsubscription wrapper functions over postMessageToNativeApp. |
| src/post-message.ts | Adds response type entries for the two new bridge message types. |
| src/tests/push-notifications-test.ts | Adds tests for success and error scenarios for both methods. |
| README.md | Documents the two new APIs and their error cases. |
| index.ts | Exposes the new APIs from the package root. |
| .prettierignore | Normalizes /coverage entry and ignores CHANGELOG.md. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🎉 This PR is included in version 5.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Implementation of #275