GaneshSinghPapola / rn-samsung-health

React Native package to access Samsung Health data using samsung health kit android sdk
The Unlicense
37 stars 18 forks source link

"Permission canceled" when we enable all permission and hit the Done button in permission popup. #17

Open yashbytes opened 1 year ago

yashbytes commented 1 year ago

we are getting the following error when the user clicks on all the permissions or select permissions one by one.

ERROR: {"nativeStackAndroid":[],"userInfo":null,"message":"Permisson canceled","code":"EUNSPECIFIED","line":2110,"column":45,"sourceURL":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.centavizer&modulesOnly=false&runModule=true"}

` import RNSamsungHealth from 'rn-samsung-health'

useEffect(()=>{
  health();
},[])
const health = async() => {
  try{
    const auth = await RNSamsungHealth.authorize();
    let startDate = new Date().setDate(new Date().getDate()-30); // 30 days back date
    let endDate = new Date().getTime(); //today's date
    let opt = {startDate, endDate};
    const steps = await RNSamsungHealth.getDailyStepCount(opt);

  }catch(error){
    console.log("error ", error)
  }
}`

![Screenshot_2023_0324_123205](https://user-images.githubusercontent.com/117064446/227448822-ba1c5b73-a9d1-44c9-955e-7d1b85692084.jpg)

If anyone has any solution to fix this issue then please suggest and share with us and help us to resolve this issue. For us it's really important to fix this issue. Thanks!!
Thuan60th4 commented 1 year ago

have u fixed it yet?

imfelixng commented 1 month ago

Have you enabled developer mode? @yashbytes I don't see any sliders for the dialog