ionic-team / capacitor-site

Capacitor website
https://capacitorjs.com/
MIT License
4 stars 109 forks source link

Local Notificaiton not working #89

Closed dhwalin closed 4 years ago

dhwalin commented 4 years ago

import { Plugins } from '@capacitor/core'; const { LocalNotifications } = Plugins;

const createNotification = async () => {

const notifs = await LocalNotifications.schedule({
  notifications: [
    {
      title: "Title",
      body: "Body",
      id: 8,
      schedule: {
        at: new Date(Date.now() + 1000 * 5)
      },
      sound: null,
      attachments: null,
      actionTypeId: "",
      extra: null
    }
  ]
});

//console.log('scheduled data', mySchedule);
console.log('scheduled notifications', notifs);

}

This is not scheduling any notification in iOS. I have not tried in other device. But in iOS it is not working.

dhwalin commented 4 years ago

First you need to check notification permission, I was applying directly. Sorry.