ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
11.44k stars 977 forks source link

[Android] getDeliveredNotifications not implemented #1314

Closed solojuve1897 closed 4 years ago

solojuve1897 commented 5 years ago

Description of the problem: When calling method getDeliveredNotifications the following is shown in the logcat:

Sending plugin error: {"save":false,"callbackId":"119341262","pluginId":"PushNotifications","methodName":"getDeliveredNotifications","success":false,"error":{"message":"not implemented"}}

Affected platform

OS of the development machine

Other information:

Capacitor version: Beta. 19 node version:

npm version:

CocoaPods version:

Steps to reproduce:

Link to sample project:

mlynch commented 5 years ago

@jcesarmobile my read of the Android docs suggest that we would need to implement NotificationManager.getActiveNotifications(): https://developer.android.com/reference/android/app/NotificationManager.html#getActiveNotifications()

This API is only available on API 23 (our min is 21), but we should just support it conditionally for 23 and above.

skeemer commented 4 years ago

The getActiveNotifications() method does not in any way lead to getting data passed by notifications. You can access PendingIntent, but they have blocked accessing the data in the Intent for security reasons.

https://stackoverflow.com/questions/23725035/how-to-get-intent-from-pendingintent/23725068#23725068

jcesarmobile commented 4 years ago

It was implemented using getActiveNotifications in https://github.com/ionic-team/capacitor/pull/2266

ionitron-bot[bot] commented 1 year ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.