NativeScript / NativeScript/plugins

[@nativescript/local-notifications] App crash when addOnMessageClearedCallback

Open
#158 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
206
Forks
123
Avg merge
2d 1h
Merged PRs (30d)
1

Description

The app crashed when setting a callback for the user clearing the notification.

Error: Unable to start receiver com.telerik.localnotifications.NotificationClearedReceiver: com.tns.NativeScriptException: Cannot find object id for instance=com.tns.gen.com.telerik.localnotifications.LocalNotificationsPluginListener@ce7d97
System.err: com.tns.NativeScriptException: Error: Cannot convert object to Ljava/lang/Throwable; at index 0
System.err:     at com.tns.Runtime.passExceptionToJsNative(Native Method)
System.err:     at com.tns.Runtime.passUncaughtExceptionToJs(Runtime.java:84)
System.err:     at com.tns.NativeScriptUncaughtExceptionHandler.uncaughtException(NativeScriptUncaughtExceptionHandler.java:34)
System.err:     at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
System.err:     at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
System.err:     at java.lang.Thread.dispatchUncaughtException(Thread.java:2203)

NativeScript: 7.3.0
Device: Samsung A52 Android 11
@nativescript/local-notifications: "^5.1.0"

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the crash when setting addOnMessageClearedCallback on Android with NativeScript 7.3.0, then inspect the notification-cleared callback path in @nativescript/local-notifications. Done means clearing a notification invokes the callback without the NativeScriptException or app crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, typescript
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.