Closed chief10 closed 8 years ago
Hmm, that is weird -- ng2 should not cause any issues with the permissions system. Is this Android 4.4, 5, 6, or 7?
You are the shit. Didn't realize that my emulator was running version 7 -- idk why it would be. When I run this on my phone -- version 6 -- it works just fine.
Know what the problem could be with version 7?
Thanks again for helping me out with this. You rock.
Interesting. I haven't had a chance to mess with 7; but my guess is they must have made some more permissions changes; or the compatibility layer that Google uses to allow 4.4 to work are well as 7 doesn't work properly in 7 yet... Guess I need to download a 7 emulator image. :grinning:
Just noticed something interesting too. After I tried pulling that code into my actual application -- the code that is working and on android 6.0 -- I started getting the same error as before. Only after completely erasing the application off my phone and reinstalling it, was I able to get the prompt so show up. I wonder if at some point I implemented your plugin incorrectly and nativescript saved the value from that instance for future requests?
EDIT: Confirmed. After deleting my app in my emulator -- running Android 7 -- and reinstalling it, this module started working as expected. This seems like more of an issue with nativescript itself, rather than your plugin.
Actually, not an issue with NativeScript -- the OS itself will save your setting -- this is by design; the idea is that the OS asks you and most the time will never re-ask you again either direction... So you need to go to Settings -> Security -> and then ether clear all saved app settings or clear the app itself (depends on OS)
I have started a new project using the
tns
for an angular project, and I have copied your example code almost verbatim, but when I go to request the permission, it automatically fails without prompting the user at all. Here goes the code:In
app.component.ts
:And in my android manifest file:
The error message:
Am I missing something obvious here?