iOS Question moreBackgroundTime and #PlistExtra

Alessandro71

Well-Known Member
Licensed User
Longtime User
referring to this code, that allows some more time when the app goes to background

B4X:
Sub Application_Background
   Dim nativeMe As NativeObject = Me
   nativeMe.RunMethod("moreBackgroundTime", Null)
End Sub

#If OBJC
- (void)moreBackgroundTime {
   UIApplication* app = [UIApplication sharedApplication];
   UIBackgroundTaskIdentifier bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
     [app endBackgroundTask: bgTask];
   }];
}
#end if

does it need a UIBackgroundModes processing plist entry?

B4X:
#PlistExtra: </array>
#PlistExtra: <key>UIBackgroundModes</key>
#PlistExtra: <array>
#PlistExtra:   <string>processing</string>
#PlistExtra: </array>

I've found it used in a project that has these plist, but I'm not sure if it's a requirement or not
 
Top