|
|
#1 |
|
Local Push Notifications
Hi Guys,
I have read the documentation on developer.apple.com about the push notifications however I still can seem to get it right, is there someone I can talk to who can guide me on how to build local push notifications for my app? Regards, Ghost
__________________
- 30 GB iPod Video - Black - 13.3" MB - 4GB RAM - 500GB 7200RPM HDD - 16 GB iPhone 4 - Black - Game Center Tag: GhostDZ9 |
|
|
|
0
|
|
|
#2 | |
|
Quote:
Code:
UILocalNotification* note = [[UILocalNotification alloc] init]; note.fireDate = [NSDate date]; note.timeZone = [NSTimeZone defaultTimeZone]; note.repeatInterval = NSDayCalendarUnit; note.alertBody = NSLocalizedString(@"It's a notification!",@""); note.alertAction = NSLocalizedString(@"Hi there",@""); [[UIApplication sharedApplication] scheduleLocalNotification:note]; [note release];
__________________
Aaron Brethorst - iOS and Rails developer, proprietor of Cocoa Controls Sandy Bridge MBP 2.3 / mid 2010 iMac / iPhones / iPads |
||
|
|
0
|
|
|
#3 |
|
appdelegate =
Code:
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
NSLog(@"This was fired off");
}
Code:
UIApplication *app = [UIApplication sharedApplication];
UILocalNotification *notification = [[UILocalNotification alloc] init];
NSArray *oldNotifications = [app scheduledLocalNotifications];
if ([oldNotifications count] > 0) {
[app cancelAllLocalNotifications];
}
if (notification == nil)
return;
NSDate *notificationDate = [NSDate dateWithTimeIntervalSinceNow:10];
notification.fireDate = notificationDate;
notification.timeZone = [NSTimeZone systemTimeZone];
notification.alertBody = @"Woop example";
[app scheduleLocalNotification:notification];
[notification release];
gl
|
|
|
|
0
|
|
|
#4 |
|
Great thanks guys, Ill try these out now, do you guys know if alerts work outside the app when it isn't launched?
__________________
- 30 GB iPod Video - Black - 13.3" MB - 4GB RAM - 500GB 7200RPM HDD - 16 GB iPhone 4 - Black - Game Center Tag: GhostDZ9 |
|
|
|
0
|
|
|
#5 |
|
Afaik, u need the push notifications from Apple then, which is something totally different.. Sorry, no experience with that.
|
|
|
|
0
|
|
|
#6 |
|
Well I want to have it so when the user sets a time for when they have to be back it shows a notification with the notes that they have entered in, how can i customize the code that you have given me?
__________________
- 30 GB iPod Video - Black - 13.3" MB - 4GB RAM - 500GB 7200RPM HDD - 16 GB iPhone 4 - Black - Game Center Tag: GhostDZ9 |
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| How to edit push notifications? Please help! | ryanstewart | iOS 5 and earlier | 13 | Apr 2, 2012 01:20 PM |
| Please Help, Push Notifications Not Working | RonYosafi | Jailbreaks and iOS Hacks | 6 | Apr 21, 2011 03:14 PM |
| Ad Hoc build not registering for push notifications | SimonBS | iPhone/iPad Programming | 0 | Mar 21, 2011 03:53 PM |
| POLL: Lion Push Notification | tourada | Mac OS X 10.7 Lion | 4 | Mar 20, 2011 08:53 AM |
| Easy Reminders - Local push notifications with Snooze | arytbk | iPhone and iPod touch Apps | 0 | Nov 1, 2010 09:44 AM |
All times are GMT -5. The time now is 03:52 PM.








gl
Linear Mode

