Hi,
I'm trying to use this plugin and got the following error:
JS: ORIGINAL EXCEPTION: TypeError: Cannot read property 'failed' of undefined
JS: ORIGINAL STACKTRACE:
JS: TypeError: Cannot read property 'failed' of undefined
JS: at Object.callback (/data/data/org.nativescript.sParks/files/app/tns_modules/nativescript-permissions/permissions.js:49:11)
JS: at AndroidApplication.Observable.notify (/data/data/org.nativescript.sParks/files/app/tns_modules/data/observable/observable.js:155:23)
JS: at NativeScriptActivity.onRequestPermissionsResult (/data/data/org.nativescript.sParks/files/app/tns_modules/ui/frame/frame.js:662:29)
JS: at enableLocationRequestCore (/data/data/org.nativescript.sParks/files/app/tns_modules/nativescript-geolocation/nativescript-geolocation.js:224:51)
JS: at Object.enableLocationRequest (/data/data/org.nativescript.sParks/files/app/tns_modules/nativescript-geolocation/nativescript-geolocation.js:145:5)
JS: at AppComponent.enableLocation (/data/data/org.nativescript.sParks/files/app/app.component.js:80:25)
JS: at AppComponent.onMapReady (/data/data/org.nativescript.sParks/files/app/app.component.js:59:14)
JS: at DebugAppView._View_AppComponent0._handle_mapReady_2_0 (AppComponent.template.js:605:28)
JS: at Object.<anonymous> (/data/data/org.nativescript.sParks/files/app/tns_modules/@angular/core/src/linker/view.js:316:24)
JS: at ZoneDelegate.invoke (/data/data/org.nativescript.sParks/files/app/tns_modules/zone.js/dist/zone-node.js:281:29)
JS: ERROR CONTEXT:
JS: [object Object]
The line 49 is using promises which seems to be undefined. Here is the incriminated function:
application.android.on(application.AndroidApplication.activityRequestPermissionsEvent, function(args) {
// get current promise set
var promises = pendingPromises[args.requestCode];
// Delete it
delete pendingPromises[args.requestCode];
// Check the status of the permission
if (args.grantResults.length > 0) {
if (args.grantResults[0] === android.content.pm.PackageManager.PERMISSION_GRANTED) {
promises.granted();
return;
}
}
promises.failed();
});
Why is promises undefined ?
I'm using the plugin exactly as the README suggests it.
Hi, I'm trying to use this plugin and got the following error:
The line 49 is using
promises
which seems to be undefined. Here is the incriminated function:Why is promises undefined ? I'm using the plugin exactly as the README suggests it.