Skip to content
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

[Bug]: Cannot clear all notifications on iOS #699

Closed
2 of 3 tasks
huubao2309 opened this issue Jul 30, 2023 · 2 comments
Closed
2 of 3 tasks

[Bug]: Cannot clear all notifications on iOS #699

huubao2309 opened this issue Jul 30, 2023 · 2 comments

Comments

@huubao2309
Copy link

huubao2309 commented Jul 30, 2023

What happened?

Currently, I want to clear all app notifications of my app on the devices after the user logouts. OneSignal has supported OneSignal.shared.clearOneSignalNotifications() for clearing all notifications of the app. But this method only works on Android. On iOS, It throws an exception

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method OneSignal#clearOneSignalNotifications on channel OneSignal)
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:294:7)
<asynchronous suspension>
#1      OneSignal.clearOneSignalNotifications (package:onesignal_flutter/onesignal_flutter.dart:312:12)
<asynchronous suspension>

Steps to reproduce?

Using `OneSignal.shared.clearOneSignalNotifications()`method on iOS platform

What did you expect to happen?

It seems that clearOneSignalNotifications() is not implemented on iOS. Currently, I am using the library clear_all_notifications to fix this bug. I expect onesignal_flutter to fix this bug in the next versions. Thanks

OneSignal Flutter SDK version

3.5.1

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.9, on macOS 13.4.1 22F770820d darwin-arm, locale en-VN)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] IntelliJ IDEA Community Edition (version 2023.1.2)
[✗] Cannot determine if IntelliJ is installed
    ✗ Directory listing failed
[✓] VS Code (version 1.80.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ChoyCheeWei
Copy link

any updates on this?

@jennantilla
Copy link
Contributor

@huubao2309 apologies that your issue was missed!

In our User Model SDKs (>=5.0.0), you may clear all notifications on both iOS and Android by calling:

OneSignal.Notifications.clearAll();

Please upgrade to the latest Flutter SDK to use it. Please refer to our migration guide for full details on updating!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants