cordova-plugin-fcm-with-dependecy-updated icon indicating copy to clipboard operation
cordova-plugin-fcm-with-dependecy-updated copied to clipboard

Again notifications and SDK UPGRADE

Open michal-kroliczek opened this issue 1 year ago • 3 comments

Starting with SDK 33 they introduced runtime permissions for notifications. From docs: image

So all our apps (cordova not yet support sdk 33) installed first time on Android 13 will use this logic. I have a problem with my app, that it does not ask for the permission until I literally send first push notification and when the app is in foreground then it asks me for the permission. So 1 notification is always gone. After allowing, it works fine.

So the qustion is - what does it mean to open notification channel? Are you experiencing the same?

Regards, Michal

michal-kroliczek avatar Apr 01 '23 22:04 michal-kroliczek

Oh wait, are you creating your notification channel on-the-fly? You could create the notification channel in the app onCreate instead.

dchase-sir avatar Jun 28 '23 16:06 dchase-sir

@dchase-sir will it then automatically display Allow notifications prompt?

markokitanoski1 avatar Jul 05 '23 07:07 markokitanoski1

Hi @michal-kroliczek , you can check out this fork: https://github.com/4sh/cordova-plugin-fcm-with-dependecy-updated

We've just added the support for Android 13+ and updated the README page on our fork.

Installation can be done by targetting the git tag:

npm way

npm install cordova-plugin-fcm-with-dependecy-updated@git+https://github.com/4sh/cordova-plugin-fcm-with-dependecy-updated.git#7.10.0

old cordova fashion way (not tested)

cordova plugin add cordova-plugin-fcm-with-dependecy-updated@git+https://github.com/4sh/cordova-plugin-fcm-with-dependecy-updated.git#7.10.0

Afterward, in your app, calling FCM.requestPushPermission() will trigger the permission dialog on Android 13+.

mcastets avatar Jul 11 '23 14:07 mcastets