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

Android Oreo (Api Version>=26 ) not working #31

Closed
appielife opened this issue Mar 30, 2018 · 9 comments
Closed

Android Oreo (Api Version>=26 ) not working #31

appielife opened this issue Mar 30, 2018 · 9 comments

Comments

@appielife
Copy link

The package is not working for android version greater than 8.
https://developer.android.com/guide/components/broadcast-exceptions.html

@gj1118
Copy link

gj1118 commented Apr 2, 2018

Can someone please confirm ?

Thanks
Gagan

@ghost
Copy link

ghost commented Apr 30, 2018

Confirmed. Not working for API Version >= 26

@kr4ckhe4d
Copy link

kr4ckhe4d commented Jun 4, 2018

Solved the issue by Requesting SMS Read permission and SMS Receive permissions when starting the react native app.

import { PermissionsAndroid } from 'react-native';

componentDidMount() {
this.requestReadSmsPermission();
}

async requestReadSmsPermission() {
try {
var granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.READ_SMS,
{
title: "Auto Verification OTP",
message: "need access to read sms, to verify OTP"
}
);
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
console.log("sms read permissions granted", granted);
granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.RECEIVE_SMS,{
title: "Receive SMS",
message: "Need access to receive sms, to verify OTP"
}
);
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
console.log("RECEIVE_SMS permissions granted", granted);
} else {
console.log("RECEIVE_SMS permissions denied");
}
} else {
console.log("sms read permissions denied");
}
} catch (err) {
console.log(err);
}
}

@ckOfor
Copy link

ckOfor commented Aug 6, 2019

Tried to use permissions API but the host Activity doesn't implement PermissionAwareActivity.

@ironhide0396
Copy link

Tried the above steps , but still cant seem to make it work .
Permissions always return NEVER_ASK_AGAIN .
I have tried uninstalling the app,clearing data,changing version number but still of no use.
Any other workaround or fix for this issue ?

@shubham2102
Copy link

Ask for READ_SMS as well as RECEIVE_SMS permission, it will work in sdk version 28.

@MajdAbuRoqa
Copy link

tried the above solution , permissions granted but the message not read

@PragyaSingla
Copy link

Tried integrating this library but its not auto reading messages. Please provide any solution

@venkatesh-appoids
Copy link

@kr4ckhe4d you made my day

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

10 participants