i want use local notification in app want send birthday message user every year.
1)how can schedule notification in specific date , time? here using display.getinstance().schedulelocalnotification, can set time schedule notification how can set specific date , time?
2)there repeat_none, minute,hour,day,week there repeat_year well?
3)is there specific use override method of localnotification ie. localnotificationreceived()? have system.out , dialog.show methods both doesnt show when notification shows up.
public class localnotificationtest implements localnotificationcallback { public void noti(){ localnotification n = new localnotification(); n.setalertbody("body"); n.setalerttitle("title"); n.setid("id"); display.getinstance().schedulelocalnotification(n, system.currenttimemillis() + 10 * 1000, localnotification.repeat_none); } @override public void localnotificationreceived(string notificationid) { system.out.println("received local notification "+notificationid+" in callback localnotificationreceived"); dialog.show("noti", "checking notifications", "ok", null); } }
you set repeat week, example, , in callback increment counter until 52nd occurrence when notify user, ignoring first 51 instances of getting notifications.
the counter value can stored in preferences persistence.
Comments
Post a Comment