Open dlcole opened 4 years ago
@dlcole Have you managed to solve the problem or found any workaround? I have same problem
@bachras Unfortunately I have not. As far as I can tell, this plug-in is abandoned and simply does not work on NativeScript 6.0 or later. If you find that's not the case, please post here.
It works fine but you have to request permission with https://github.com/NathanaelA/nativescript-permissions.
Something like this:
setTimeout(function() {
permissions
.requestPermission(
android.Manifest.permission.READ_PHONE_STATE,
"I need these permissions because I'm cool"
)
.then(() => {
console.log("Woo Hoo, I have the power!");
Telephony()
.then(function(resolved) {
console.log("resolved >", resolved);
console.dir(resolved);
})
.catch(function(error) {
console.error("error >", error);
console.dir(error);
});
})
.catch(() => {
console.log("Uh oh, no permissions - plan B time!");
});
}, 100);
I updated my project to NativeScript 6 and also updated Android Studio. Now, on both emulators and real devices, I get permission errors when I invoke telephony():
Adding the permissions to my own AndroidManifest.xml makes no difference. And, Google Play has a recent policy that restricts READ_SMS to apps that can act as the default text app.
I realize this repository hasn't been active recently but I'm hoping for some insight.