When I start the app the line 112 of LocationManager.m throw a error
The line:
locationManager.allowsBackgroundLocationUpdates = YES;
The error:
* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: !stayUp || CLClientIsBackgroundable(internal->fClient)'
* First throw call stack:
(
0 CoreFoundation 0x06139bf2 __exceptionPreprocess + 194
1 libobjc.A.dylib 0x04c38e66 objc_exception_throw + 52
2 CoreFoundation 0x0613dd12 +[NSException raise:format:arguments:] + 130
3 Foundation 0x04838af4 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 94
4 CoreLocation 0x01880ad8 CLClientGetCapabilities + 12072
7 libobjc.A.dylib 0x04c4e36b +[NSObject new] + 69prepareModulesWithDispatchGroup:]_block_invoke + 139
13 libdispatch.dylib 0x06f7d396 _dispatch_call_block_and_release + 15
14 libdispatch.dylib 0x06fa8cc3 _dispatch_client_callout + 14
15 libdispatch.dylib 0x06f87c55 _dispatch_main_queue_callback_4CF + 662
16 CoreFoundation 0x060fa05e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14
17 CoreFoundation 0x060bc8df __CFRunLoopRun + 2319
18 CoreFoundation 0x060bbd5b CFRunLoopRunSpecific + 395
19 CoreFoundation 0x060bbbbb CFRunLoopRunInMode + 123
20 GraphicsServices 0x0927ab4c GSEventRunModal + 177
21 GraphicsServices 0x0927a9c7 GSEventRun + 80
22 UIKit 0x02ebbff3 UIApplicationMain + 148
24 libdyld.dylib 0x06fe3799 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
You need to add following into your projects Info.plist file
UIBackgroundModes "location"
NSLocationAlwaysUsageDescription "your description"
UIBackgroundModes must be an array of strings, where one string is required - "location", so source code of Info.plist should look like:
...
<key>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
...
<key>NSLocationAlwaysUsageDescription</key>
<string>App requires background tracking</string>
...
This is already mentioned in README section iOS Setup.
Most helpful comment
You need to add following into your projects Info.plist file
UIBackgroundModes "location"
NSLocationAlwaysUsageDescription "your description"
UIBackgroundModes must be an array of strings, where one string is required - "location", so source code of Info.plist should look like: