有没有办法让iOS的本地推送通知在OSX上工作?我有一个程序,即使程序关闭,我也希望从本地计算机收到预定的通知。我可以在OSX上使用iOS的本地推送通知吗
2
A
回答
-1
0
这是本地通知
- (void)scheduleNotificationWithItem:(ToDoItem *)item interval:(int)minutesBefore {
NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar];
NSDateComponents *dateComps = [[NSDateComponents alloc] init];
[dateComps setDay:item.day];
[dateComps setMonth:item.month];
[dateComps setYear:item.year];
[dateComps setHour:item.hour];
[dateComps setMinute:item.minute];
NSDate *itemDate = [calendar dateFromComponents:dateComps];
[dateComps release];
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
if (localNotif == nil)
return;
localNotif.fireDate = [itemDate addTimeInterval:-(minutesBefore*60)];
localNotif.timeZone = [NSTimeZone defaultTimeZone];
localNotif.alertBody [email protected]"Local Notification";
localNotif.alertAction = NSLocalizedString(@"View Details", nil);
localNotif.soundName = UILocalNotificationDefaultSoundName;
localNotif.applicationIconBadgeNumber = 1;
NSDictionary *infoDict = [NSDictionary dictionaryWithObject:item.eventName forKey:ToDoItemKey];
localNotif.userInfo = infoDict;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
[localNotif release];
}
相关问题
- 1. iOS + XMPP - 我可以在iOS中实现推送通知XMPPFramework吗?
- 2. GCM可以向VoIP iOS发送推送通知消息吗?
- 3. 用户可以在本地禁用推送通知的声音吗?
- 4. 我们可以使用Twilio iOS SDK进行VOIP推送通知吗?
- 5. 如何在iOS 3.0中使用本地推送通知?
- 6. 我应该使用推送还是可以使用本地通知?
- 7. 发送推送IOS上的FCM通知
- 8. 本地推送通知wp7
- 9. 我可以要求用户启用推送通知吗?
- 10. 黑莓推送通知(本地通知)
- 11. 使用react-native创建本地推送通知 - IOS
- 12. 我可以从后台取消iOS本地通知吗?
- 13. 推送通知IOS
- 14. 推送通知IOS
- 15. 我们可以在模拟器中检查推送通知吗?
- 16. 我应该使用哪些通知,推送通知或本地通知?
- 17. iOS开发:推送通知,防止我的本地通知从发射
- 18. 我可以在不推送通知的情况下使用Scial.framework吗?
- 19. 使用FCM的iOS推送通知
- 20. 在iOS上使用休斯敦发送推送通知
- 21. 我可以在Cydia应用程序中使用Apple推送通知吗?
- 22. 推送通知服务是否可以在iPod Touch上使用?
- 23. IOS推送通知本地工作,但不是在BlueHost的
- 24. 推送通知可以跳过通知中心吗?
- 25. 我们可以使用phonegap框架在iphone中推送通知吗?
- 26. 我们可以在android中使用服务而不是推送通知吗?
- 27. Sendbird不推送iOS上的通知
- 28. iP6上的iOS推送通知
- 29. 的iOS推送通知
- 30. iOS的Ionic推送通知
我认为你知道刚才看你如何措辞这个问题的答案......话虽这么说,搜索“用户通知+山狮“,你应该找到更多的信息 – 2012-07-15 09:04:33