Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,19 @@


```typescript
import 'fancy-notifications';
import { Plugins } from '@capacitor/core';
const {FancyNotifications} = Plugins;
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{
if (check.value) {
FancyNotifications.setBadgeCount({ count: 2 });
} else {
const request = await FancyNotifications.requestPermission();
if(request.value) {
FancyNotifications.setBadgeCount({ count: 2 });
} else {
// User failed to grant permission show some dialog
}
}
}
}

Expand All @@ -42,4 +41,4 @@ async function updateBadgeCount() {

## TODO

- [ ] Add Notifications Support
- [ ] Add Notifications Support