I want a method to work in background until a duration specified by the user (let’s say 20 minutes) elapses. I know it’s not possible, because Apple allows the app to work for a maximum of 10 minutes in the background. Unfortunately FireDate works with UILocalNotifications only. I also read about performSelector:Selector:WithObject:afterDelay: method but I’m not sure if that will work in the background or not. Kindly give me suggesstions and code snippets (if any).
I want a method to work in background until a duration specified by the
Share
two methods that will be of use:
NSObject
-(void)performSelectorInBackground:(SEL)aSelector withObject:(id)argUIApplication
- (UIBackgroundTaskIdentifier)beginBackgroundTaskWithExpirationHandler:(void(^)(void))handler
local notifications can be used if you want the user to re-launch, but if they don’t click through to the app, then your app never knows about it