Open ash737 opened 1 year ago
I'm using ShortcutBadger latest version with
cordova-plugin-fcm-with-dependecy-updated
Notification badge update ok in ios by set badge number in payload but, in android cannot set badge in payloadHow to get this work using ShortcutBadger and FCM?
Hi did u get badge count in app icon for ios and android ? or ios only ? pls reply i stuck in show badge count in app icon for android cant find it. Can you share code how to set badge count and update ?
Hi, In iOS, you have to store notification info into database then, calculate badge number, increase one, and set it in payload as badge:
function send_notification ($notiunreadNO, $token, $message, $title)
{
$notiunreadNO = $notiunreadNO + 1;
$fields = array(
'to' => $token,
'notification' => array('title' => $title, 'body' => $message, 'click_action' => 'FCM_PLUGIN_ACTIVITY', 'badge' => $notiunreadNO),
'data' => array('title' => $title, 'body' => $message),
'sound' => 'default'
);
}
For android, I still looking for a solution.
I'm using ShortcutBadger latest version with
cordova-plugin-fcm-with-dependecy-updated
Notification badge update ok in ios by set badge number in payload but, in android cannot set badge in payload How to get this work using ShortcutBadger and FCM?Hi did u get badge count in app icon for ios and android ? or ios only ? pls reply i stuck in show badge count in app icon for android cant find it. Can you share code how to set badge count and update ?
Hi, In iOS, you have to store notification info into database then, calculate badge number, increase one, and set it in payload as badge:
function send_notification ($notiunreadNO, $token, $message, $title) { $notiunreadNO = $notiunreadNO + 1; $fields = array( 'to' => $token, 'notification' => array('title' => $title, 'body' => $message, 'click_action' => 'FCM_PLUGIN_ACTIVITY', 'badge' => $notiunreadNO), 'data' => array('title' => $title, 'body' => $message), 'sound' => 'default' ); }
For android, I still looking for a solution.
I'm using ShortcutBadger latest version with
cordova-plugin-fcm-with-dependecy-updated
Notification badge update ok in ios by set badge number in payload but, in android cannot set badge in payload How to get this work using ShortcutBadger and FCM?Hi did u get badge count in app icon for ios and android ? or ios only ? pls reply i stuck in show badge count in app icon for android cant find it. Can you share code how to set badge count and update ?
Ok , Thanks for your reply, i tried with "cordova-plugin-firebase-messaging 7.0.4 "FirebaseMessagingPlugin" , but still cant in Android, If found solution, please share it.
Hi, In iOS, you have to store notification info into database then, calculate badge number, increase one, and set it in payload as badge:
function send_notification ($notiunreadNO, $token, $message, $title) { $notiunreadNO = $notiunreadNO + 1; $fields = array( 'to' => $token, 'notification' => array('title' => $title, 'body' => $message, 'click_action' => 'FCM_PLUGIN_ACTIVITY', 'badge' => $notiunreadNO), 'data' => array('title' => $title, 'body' => $message), 'sound' => 'default' ); }
For android, I still looking for a solution.
I'm using ShortcutBadger latest version with
cordova-plugin-fcm-with-dependecy-updated
Notification badge update ok in ios by set badge number in payload but, in android cannot set badge in payload How to get this work using ShortcutBadger and FCM?Hi did u get badge count in app icon for ios and android ? or ios only ? pls reply i stuck in show badge count in app icon for android cant find it. Can you share code how to set badge count and update ?
Could you share code which set badge in device ? i mean how to set badge count in mobile device , above is payload to send notification, but i need in mobile device how to set count ? Point 1 and 2 in which file need to add and point 3 ondeviceready function need to add ?
I'm using ShortcutBadger latest version with
cordova-plugin-fcm-with-dependecy-updated
Notification badge update ok in ios by set badge number in payload but, in android cannot set badge in payloadHow to get this work using ShortcutBadger and FCM?