npm i fancy-notifications
import 'fancy-notifications';
import { Plugins } from '@capacitor/core';
const {FancyNotifications} = Plugins;
async function updateBadgeCount() {
const check = await FancyNotifications.hasPermission();
if(check.value){
FancyNotifications.setBadgeCount(2);
}else{
const request = await FancyNotifications.requestPermission();
if(request.value){
FancyNotifications.setBadgeCount(2);
}else{
// User failed to grant permission show some dialog
}
}
}
Method | Default | Type | Description |
---|---|---|---|
hasPermission | Promise<{value:boolean}> |
||
requestPermission | Promise<{value:boolean}> |
||
setBadgeCount | Promise<any> |
||
clearBadgeCount | Promise<any> |
- Add Notifications Support