2012-03-02 126 views
2

我开发与PhoneGap的iOS应用程序,需要为它设置本地通知周五将重复在每个和指定时间注册本地通知

也有要求,即用户将决定接受或不在本地通知

回答

3

我建议你阅读的话题下面的文章,我发现非常有用

http://useyourloaf.com/blog/2010/7/31/adding-local-notifications-with-ios-4.html

- (void)scheduleNotification { 

    [[UIApplication sharedApplication] cancelAllLocalNotifications]; 

     UILocalNotification *notif = [[UILocalNotification alloc] init]; 
     notif.fireDate = [datePicker date]; 
     notif.timeZone = [NSTimeZone defaultTimeZone]; 

     notif.alertBody = @"Body"; 
     notif.alertAction = @"AlertButtonCaption"; 
     notif.soundName = UILocalNotificationDefaultSoundName; 
     notif.applicationIconBadgeNumber = 1; 

     [[UIApplication sharedApplication] scheduleLocalNotification:notif]; 
     [notif release]; 
    } 
} 

这只是它是如何工作,但从此开始,你应该能够安排通知的基本轮廓。

+1

我可以安排通知,但如何重复它的每个星期五,也发送本地通知 – user1244533 2012-03-02 10:18:55

+1

WTF甲肝你曾经自己做任何事情之前,如何激活用户注册? – 2016-01-17 11:01:38