Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How To set Custom repeat interval For Nslocal Notification.....?

i am New to iphone Development .I Am Trying To Use NslocalNotification In My Project I Need To Give Remeinder For Every 2Hours or For Every Two Days Or For Every Two Months Etc..Currently I am Using NslocalNotification Repeat Interval .But Its Working For Only Every Minute For Every Hour using Nscalender ....

        NSString *InterVal=[freQuencyArr objectAtIndex:index-2];
        NSString *InterValType=[freQuencyArr objectAtIndex:index-1];
        if(![InterVal isEqualToString:@"Every"])
        {  
         result=[InterVal intValue];
        }else
          result=1;
        if([InterValType isEqualToString:@"Day"]){
             notification.repeatInterval= NSDayCalendarUnit;    
        }else if([InterValType isEqualToString:@"Week"]){
            notification.repeatInterval= NSWeekCalendarUnit;    
         }
        else if([InterValType isEqualToString:@"Month"]){
            notification.repeatInterval= NSMonthCalendarUnit;   
        }else if([InterValType isEqualToString:@"days"]){
             notification.repeatInterval=result*24*60*60;
        }

here If result is 2 depend Up on IntervalType I Need Notification its Not Working With Me

         if([InterValType isEqualToString:@"days"]){
             notification.repeatInterval=result*24*60*60;
        }
like image 283
Srinivas Avatar asked Aug 09 '11 05:08

Srinivas


1 Answers

@Srinivas:

If you look at the link I have posted in this answer, You will come to know that I have tried every possible solution here to try and do what you want currently.

I had tried all this to implement it in my app, but this doesn't work.

I am afraid to say this but this is not possible. It only allows the unit NSCalendarUnit objects to be set as a repeat interval.

I invested almost 2 months (I asked the question in Dec 2010 and answered it myself in February 2011) to try and implement every possible solution available on internet through different articles and different forums but none did help.

Check out my link and lookout for all the answers if something is useful to you.

How to set Local Notification repeat interval to custom time interval?

Really Hope that this helps you.

like image 70
Parth Bhatt Avatar answered Oct 04 '22 16:10

Parth Bhatt