Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug]: (Push-Notification) Registration listener returns old Token if register is called immediatly after unregister

オープン
#2,593 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@ciccilleju がすでに取り組んでいます。

2026年10月5日 から。

  • #2607 @ciccilleju による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
android, java, javascript
領域
mobile-dev

調査の方向性

リンクされた StackBlitz の再現ケースから始め、Android で実行して、addListener → unregister → register のシーケンスに焦点を当てます。次に、@capacitor/push-notifications の Android 実装と、その登録イベントの経路を追跡します。完了条件は、unregister の後の各 register 呼び出しで、以前のトークンではなく新しく発行されたトークンが返され、交互に変化する動作がカバーされていることです。

索引モデルが issue の本文から書いたものです。

説明

platform: android triage
Capacitor Version

Capacitor Doctor

Latest Dependencies:

@capacitor/cli: 8.5.1
@capacitor/core: 8.5.1
@capacitor/android: 8.5.1
@capacitor/ios: 8.5.1

Installed Dependencies:

@capacitor/core: 8.4.0
@capacitor/android: 8.4.0
@capacitor/cli: 8.4.0
@capacitor/ios: 8.4.0
@capacitor/push-notifications: 8.0.3

[success] Android looking great! 👌
[error] Xcode is not installed

Other API Details
npm --version output: 11.12.1
node --version output: 24.16.0
Platforms Affected
  • iOS
  • Android
  • Web
Current Behavior

If we call register immediatly after having called unregister, we get the already existing token again.
This behaviour can be reproduced every second time this sequence is called.

await PushNotifications.addListener('registration', (token: Token) => {...});
await PushNotifications.unregister();
await PushNotifications.register();
Expected Behavior

We get a new Token everytime we call await PushNotifications.register();

Project Reproduction

https://stackblitz.com/edit/angular-4zsdop-napdpb7a?file=src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.component.html

Additional Information

The reproduction is only theoretical since a real setup requires a running Android System.

In our App we would like to give the User the option to exchange the existing token with a new one.

主要言語
Java
スター
687
フォーク
691
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ionic-team/capacitor-plugins のほかの issue

ionic-team/capacitor-plugins の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。