feat(messaging): add apnsTokenReceived listener#964
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new getApnsToken() API to the Messaging plugin to expose the native iOS APNs device token to JavaScript (and documents/releases it), while returning “unimplemented” on non‑iOS platforms.
Changes:
- Added
getApnsToken()to the TypeScript plugin interface and web implementation (unimplemented on web). - Implemented
getApnsTokenon iOS (Swift) and added an Android stub returning unimplemented. - Updated README docs and added a changeset for a minor release.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/messaging/src/web.ts | Adds getApnsToken() stub that throws unimplemented on web. |
| packages/messaging/src/definitions.ts | Extends the public TS API with getApnsToken() and GetApnsTokenResult. |
| packages/messaging/ios/Plugin/FirebaseMessagingPlugin.swift | Exposes getApnsToken as a Capacitor bridged method. |
| packages/messaging/ios/Plugin/FirebaseMessaging.swift | Implements APNs token retrieval and hex encoding on iOS. |
| packages/messaging/android/.../FirebaseMessagingPlugin.java | Adds Android getApnsToken() method returning unimplemented. |
| packages/messaging/README.md | Documents getApnsToken() and the result type. |
| .changeset/feat-get-apns-token.md | Declares a minor version bump for the new API. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@capacitor-firebase/analytics
@capacitor-firebase/app
@capacitor-firebase/app-check
@capacitor-firebase/authentication
@capacitor-firebase/crashlytics
@capacitor-firebase/firestore
@capacitor-firebase/functions
@capacitor-firebase/messaging
@capacitor-firebase/performance
@capacitor-firebase/remote-config
@capacitor-firebase/storage
commit: |
getApnsToken methodapnsTokenReceived listener
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This reverts commit 1e89351.
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.
Summary
apnsTokenReceivedevent listener to the Cloud Messaging plugin that fires when the native iOS APNs device token is received.Close #602