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

Inconsistent data return from checkIfHasSMSPermission #77

Open
alokpant opened this issue Nov 29, 2024 · 3 comments
Open

Inconsistent data return from checkIfHasSMSPermission #77

alokpant opened this issue Nov 29, 2024 · 3 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers WIP This is currently being worked upon

Comments

@alokpant
Copy link

Describe the bug
At the moment, checkIfHasSMSPermission returns multiple data types:

  1. Object (https://github.com/maniac-tech/react-native-expo-read-sms/blob/master/index.js#L56)
  2. Boolean (https://github.com/maniac-tech/react-native-expo-read-sms/blob/master/index.js#L54, https://github.com/maniac-tech/react-native-expo-read-sms/blob/master/index.js#L44)

As per documentation, it says that it returns an object:
https://github.com/maniac-tech/react-native-expo-read-sms/blob/master/README.md?plain=1#L49

To Reproduce
Steps to reproduce the behavior:

  1. Call the method
const permissions = await checkIfHasSMSPermission();
  1. it returns either true or { hasReceiveSmsPermission: true/false, hasReadSmsPermission: true/false }

Expected behavior
It should always return an object or boolean.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: Oneplus 8T
  • OS: Android
  • Browser (compiled app using Android Studio + Expo
  • Version OxygenOS 14.0

Additional context
Add any other context about the problem here.

@alokpant
Copy link
Author

Also created a PR on the fix: #76

In the PR, i went with returning the boolean, since we can use return value for updating multiple states. This would help with multiple cases, for example to either for READ_SMS or RECEIVE_SMS.

@maniac-tech
Copy link
Owner

Also created a PR on the fix: #76

In the PR, i went with returning the boolean, since we can use return value for updating multiple states. This would help with multiple cases, for example to either for READ_SMS or RECEIVE_SMS.

Appreciate the effort @alokpant .

Will review the PR this week.

@maniac-tech maniac-tech self-assigned this Dec 3, 2024
@maniac-tech maniac-tech added bug Something isn't working good first issue Good for newcomers WIP This is currently being worked upon labels Dec 3, 2024
@maniac-tech
Copy link
Owner

Haven been able to review it so far.
Planning to review this by tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers WIP This is currently being worked upon
Projects
None yet
Development

No branches or pull requests

2 participants