matinzd/react-native-health-connect

Gettign setPermissionDelegate error while implementing in React native 0.72 with Java folders

codewithhannan opened this issue · 1 comments

I am using React Native 0.72 and have Java folders but the documentation shows kotlin configurations

I have added everything from documentation but in

HealthConnectPermissionDelegate.setPermissionDelegate(this); it is not building my app.

Tried to run it with Android Studio it gives following error .
Anyone can help on that?
Screenshot 2024-06-27 at 6 39 13 PM

You can do this instead:

  @Override
  public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // In order to handle contract results, we need to set the permission delegate.
    HealthConnectPermissionDelegate.INSTANCE.setPermissionDelegate(this, "com.google.android.apps.healthdata");
  }