Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-06-2012, 01:22 PM   #1 (permalink)
Registered Member
 
Join Date: Sep 2011
Posts: 38
iOS.Lover is on a distinguished road
Default Problem with repeatinterval every 30 minutes

I am trying to repeat a local notification every 30 minutes but my code does not work fine ... I would be grateful if you help me and find the solution , here is my code :

Code:
UILocalNotification *reminderNote = [[UILocalNotification alloc]init];
reminderNote.fireDate = [NSDate dateWithTimeIntervalSinceNow:60 * 30];
reminderNote.repeatInterval = NSHourCalendarUnit;
reminderNote.alertBody = @"some text";
reminderNote.alertAction = @"View";
reminderNote.soundName = @"sound.aif";
[[UIApplication sharedApplication] scheduleLocalNotification:reminderNote];
iOS.Lover is offline   Reply With Quote
Old 02-06-2012, 02:48 PM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

Quote:
but my code does not work fine
Can you be more specific? What exactly is not working about your code? Do you get the notification, at the wrong time perhaps? Do you not get notifications at all? Some other problem?
smithdale87 is offline   Reply With Quote
Old 02-06-2012, 03:16 PM   #3 (permalink)
Registered Member
 
Join Date: Sep 2011
Posts: 38
iOS.Lover is on a distinguished road
Default

Quote:
Originally Posted by smithdale87 View Post
Can you be more specific? What exactly is not working about your code? Do you get the notification, at the wrong time perhaps? Do you not get notifications at all? Some other problem?

Yes I get notification after 30 min , but the repeat process is completely disorder ... for example each 10 seconds !!
iOS.Lover is offline   Reply With Quote
Old 02-06-2012, 05:04 PM   #4 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

The only way to repeat every 30 minutes is to create 2 local notifications with an hourly repeat interval. Ex. If you want it to fire at 3:30 and every 30 minutes after that, schedule one for 3:30 and another for 4:00 both with NSHourCalendarUnit as the repeat interval.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 406
17 members and 389 guests
Alex-alex, Apptronics RBC, baja_yu, dre, FrankWeller, gwelmarten, ipodphone, jeroenkeij, jleannex55, MAMN84, n00b, pbart, reficul, Retouchable, Sami Gh, usernametaken, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,125
Posts: 402,910
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:17 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0