-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
feat: decouple push logic to be platform agnostic #5120
base: main
Are you sure you want to change the base?
feat: decouple push logic to be platform agnostic #5120
Conversation
…form agnostic this controller was ties to web, and was not compatible for react-native. We now have moves the logic that touches firebase and browser built-ins to an isolated file, and expect platforms to inject this into the controller This breaks the controller and forces the platform to inject how push notifications should be received and clicked
reduces complexity that the platform needs to write.
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
...ices-controller/src/NotificationServicesPushController/NotificationServicesPushController.ts
Show resolved
Hide resolved
...ion-services-controller/src/NotificationServicesPushController/__fixtures__/mockMessenger.ts
Show resolved
Hide resolved
...notification-services-controller/src/NotificationServicesPushController/services/services.ts
Show resolved
Hide resolved
.../notification-services-controller/src/NotificationServicesPushController/web/push-helpers.ts
Show resolved
Hide resolved
…ouple-push-logic-to-be-platform-agnostic
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
…ouple-push-logic-to-be-platform-agnostic
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
5689535
to
29ca3da
Compare
29ca3da
to
21576f2
Compare
…ouple-push-logic-to-be-platform-agnostic
…ouple-push-logic-to-be-platform-agnostic
…ouple-push-logic-to-be-platform-agnostic
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
…ouple-push-logic-to-be-platform-agnostic
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
instead the push controller will bail early and do the correct checks
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
…ouple-push-logic-to-be-platform-agnostic
Explanation
Decouples web push notifications so that the controller is platform agnostic.
This controller was tied heavily to web, and was not compatible for mobile use (react-native). We have now isolated and moved the web specific code into a single file (
web/push-helpers.ts
), and we expect the platforms to inject the push service interface into the controller (which allows platforms to controller how to display push notifications and click on push notifications).This is a large restructuring and is a breaking change.
References
Changelog
@metamask/notification-services-controller
PushService
NotificationServicesPushController
config property to inject aPushService
interface during controller creation.@metamask/notification-services-controller/push-services/web
to help web platforms inject push-services into the push controller.Checklist