Umang Galaiya
Umang Galaiya

Reputation: 702

How to send one notification on all days except Sunday in Cordova for Android?

I'm looking to notify the user to update their info every day except on Sundays. How would I do this using Cordova? I looked into LocalNotification, but it doesn't provide an option to send only on specific days.

Upvotes: 1

Views: 470

Answers (1)

Huey
Huey

Reputation: 5220

You could schedule multiple weekly notifications (adapted from sample):

days = [saturday_at_8am,sunday_at_8am];
for(i=0;i<days.length;i++){
    timing = days[i]
    cordova.plugins.notification.local.schedule({
        id: i,
        text: "Good morning!",
        firstAt: timing,
        every: "week"
    });
);

The above should schedule local notifications every Saturday & Sunday at 8am.

Upvotes: 1

Related Questions