Skip to content

feat(messaging): add apnsTokenReceived listener#964

Merged
robingenz merged 9 commits intomainfrom
feat/issue-602
Mar 30, 2026
Merged

feat(messaging): add apnsTokenReceived listener#964
robingenz merged 9 commits intomainfrom
feat/issue-602

Conversation

@robingenz
Copy link
Copy Markdown
Member

@robingenz robingenz commented Mar 30, 2026

Summary

  • Add apnsTokenReceived event listener to the Cloud Messaging plugin that fires when the native iOS APNs device token is received.
  • The token is provided as an uppercase hex-encoded string.
  • iOS only — other platforms do not emit this event.

Close #602

Copilot AI review requested due to automatic review settings March 30, 2026 15:05
@robingenz robingenz self-assigned this Mar 30, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 getApnsToken on 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.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 30, 2026

Open in StackBlitz

@capacitor-firebase/analytics

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/analytics@964

@capacitor-firebase/app

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/app@964

@capacitor-firebase/app-check

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/app-check@964

@capacitor-firebase/authentication

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/authentication@964

@capacitor-firebase/crashlytics

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/crashlytics@964

@capacitor-firebase/firestore

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/firestore@964

@capacitor-firebase/functions

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/functions@964

@capacitor-firebase/messaging

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/messaging@964

@capacitor-firebase/performance

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/performance@964

@capacitor-firebase/remote-config

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/remote-config@964

@capacitor-firebase/storage

npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/storage@964

commit: b65eb30

@robingenz robingenz changed the title feat(messaging): add getApnsToken method feat(messaging): add apnsTokenReceived listener Mar 30, 2026
@robingenz robingenz requested a review from Copilot March 30, 2026 15:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@robingenz robingenz merged commit 34dfb6b into main Mar 30, 2026
6 checks passed
@robingenz robingenz deleted the feat/issue-602 branch March 30, 2026 16:25
@github-actions github-actions bot mentioned this pull request Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Provide access to the native apple apnsToken value

2 participants