matinzd / react-native-health-connect

React native library for health connect (Android only)
http://matinzd.github.io/react-native-health-connect
MIT License
229 stars 43 forks source link

requestPermission method not returning value, kind of struct this line #176

Open Anand8293 opened 1 week ago

Anand8293 commented 1 week ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to call "requestPermission"
try {
      const result = await requestPermission([
        {
          accessType: 'read',
          recordType: 'Steps',
        },
      ]);
      **console.log('Permission Result:', result);** Not printing value
    } catch (error) {
      console.error('Permission Error:', error);
    }

Expected behavior
Should return permission lists

Environment:

XavierJDN commented 1 day ago

did you fix the issue?

GalWender commented 1 day ago

I have the same issue

matinzd commented 1 day ago

I can see that you are on the old version of react native. Please upgrade to the latest patch version of 0.72. It shouldn't be a huge upgrade. If that didn't fix the issue, let me know. Also make sure to follow the documentation for the android setup.