0

Could you explain me the correct manner to manage the background mode app work more then 3 minutes.

My app is a timer-app notification. It works fine for 3 minutes and i got local notification in the background . If I set it to more then 3 minutes, it only works (in the background) for 3 minutes, then it's not get any local notification.

I know to iPhone application apple permit a 600 seconds (10 minutes) on background task to run and Watch application apple permit a 180 seconds (3 minutes) on background task to run.

So what i have does for application active more than 3 minutes in background?

My code is as follows:

ExtensionDelegate *del = (ExtensionDelegate *)[WKExtension sharedExtension].delegate;

del.strReminderTime = 60*15; // 15 min it's not work well.
// del.strReminderTime = 60*3; // 3 min it's work fine on background mode

ReminderTimer =  [NSTimer scheduledTimerWithTimeInterval:del.strReminderTime target:self selector:@selector(notificationReminder) userInfo:nil repeats:YES];

How to implement? It is best to use.

Appreciate if any suggestion or idea.

BuLB JoBs
  • 841
  • 4
  • 20
  • Might be help https://stackoverflow.com/questions/34862160/make-timer-run-on-background-ios-for-more-than-3-minutes – iPatel Nov 07 '17 at 05:45
  • I known it's work well on iPhone app but i want to this watch application. – BuLB JoBs Nov 07 '17 at 05:47
  • Why would you continuosly run your application in the background for timing purposes? You can schedule local notifications while your app is in the foreground or you can simply use `Date` objects for measuring the amount of time your application spent in the background. There's no way to get around the 3 minute limitation if you actually need to run code in the background. – Dávid Pásztor Nov 10 '17 at 19:11
  • @DávidPásztor local notification not work well in watch app if you known local notification concept then pls give my this question answer https://stackoverflow.com/questions/47134384/watchos-app-4-0-how-to-schedule-a-local-notification – BuLB JoBs Nov 11 '17 at 05:17

0 Answers0