Skip to content

TeamMaestro/fancy-notifications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Capacitor Fancy Notifications

npm npm

Installation

  • npm i fancy-notifications

Usage

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
  }
  }
}

Api

Method Default Type Description
hasPermission Promise<{value:boolean}>
requestPermission Promise<{value:boolean}>
setBadgeCount Promise<any>
clearBadgeCount Promise<any>

TODO

  • Add Notifications Support