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

requestPermissions does not ask user for permissions #73

Open
geekmidas opened this issue Sep 29, 2020 · 5 comments
Open

requestPermissions does not ask user for permissions #73

geekmidas opened this issue Sep 29, 2020 · 5 comments

Comments

@geekmidas
Copy link

geekmidas commented Sep 29, 2020

Below is the code that I am using. When I call requestPermissions it does not ask the user for permissions. Please assist

export function useRequestPermissions() {
  const [loading, setLoading] = useState(false);
  const [granted, setGranted] = useState(false);

  useEffect(() => {
    setLoading(true);
    Fitness.requestPermissions(permissions)
      .then(authorized => {
        console.log({ authorized });
        setGranted(authorized);
        setLoading(false);
      })
      .catch(error => {
        console.log({ error });
        setGranted(false);
      });
  }, []);

  return {
    loading,
    granted,
  };
}```
@Francesco-Voto
Copy link
Contributor

Francesco-Voto commented Nov 22, 2020

Hi @geekmidas do you have some news about this? Typically this kind of problem means some problem in the configuration of the project with maybe a wrong SHA-1. Please also note that the SAH-1 is normally different from debug to release

@geekmidas
Copy link
Author

@Francesco-Voto I do not, I struggled and we postponed the feature for later. How did you set yours up?

@Francesco-Voto
Copy link
Contributor

For testing we add the debug SHA1. Typically you can find it in this way
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android.

Remember to change with your production keystore and also test it with a release build.

@nikitph
Copy link

nikitph commented Nov 23, 2020

this is happening for us too.

@yateeshkota
Copy link

yateeshkota commented Feb 26, 2021

hi, I am also facing that issue so I try another library. there I found a comment help i am able to resolve this issue please check. in app/build.gradle.

signingConfigs {
  /* debug {
    storeFile file('...')
    storePassword '...'
    keyAlias '...'
    keyPassword '...'
  } */
  ...
} 

in your_project/android delete debug.keystore
after complete this step clean and unsitall app then run again.

StasDoskalenko/react-native-google-fit#215 (comment)

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

4 participants