Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashes if location access is not given #54

Open
tvonbomhard opened this issue Jan 26, 2015 · 1 comment
Open

App crashes if location access is not given #54

tvonbomhard opened this issue Jan 26, 2015 · 1 comment

Comments

@tvonbomhard
Copy link

On IOS:
If I remove the access for the location service via the IOS general settings and then start the app again, it crashes. It tries to execute this function

window.plugins.DGGeofencing.startMonitoringSignificantLocationChanges(
function(result) {
console.log('Geo: start monitoring significant location changes');
deferred.resolve(result);
},
function(error) {
console.log('Significant-Geo: error');
signStarted = false;
deferred.reject(error);
});

and fails with an uncaught exception in IOS like that:
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* setObjectForKey: object cannot be nil (key: message)'

@bromeostasis
Copy link

@tvonbomhard you can fix this by just setting the message to initially be an empty string instead of nil.

Change

https://github.com/radshag/PhoneGap-Geofencing/blob/master/src/ios/src/DGGeofencing.m#L293

to

NSString* message = @"";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants