You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently if Google Fit is not installed, calling health.isAvailable() will open the Google Play Store to allow the user to install Google Fit. This is problematic in my application because we want to determine if Google Fit is available and then from there decide what to show the user with regards to options for enabling Google Fit integration. Checking for availability should be a separate method from helping the user install Google Fit. Alternatively, the same method isAvailable() could be used, but an optional parameter could be used to determine whether to open the Google Play Store if the package is not installed.
The text was updated successfully, but these errors were encountered:
@dariosalvi78 I will probably not be working on a hotfix for this in the short term, though it is in our backlog to fix this eventually. I agree that the flag is likely easier to implement, but I would argue that by sending the user to the Google Play Store the isAvailable() method has a side effect, and that is a bad pattern for a getter method. I think a separate method, such as openDownloadPage() or something like that would make more sense.
For now we are using a reasonable workaround for our app, which is to wait to check isAvailable() until after the user turns on Google Fit integration. To make this work, I implemented two separate methods in for our settings page: isHealthIntegrationPossible() and isHealthIntegrationAvailable(). On iOS, we check isAvailable() in both isHealthIntegrationPossible() and isHealthIntegrationAvailable(), and on an iPad this will return false. On Android, we check for the presence of the cordova-plugin-health in isHealthIntegrationPossible() and call isAvailable() from isHealthIntegrationAvailable(). The "possible" check determines whether the integration feature is visible at all, and when the integration is enabled, the "available" check determines whether the integration is used to get data from the plugin.
We still want to get this issue resolved so we can provide a better experience for Android users. Since we don't have a way to determine whether Google Fit is available that does not potentially send the user to the Google Play Store, we can't provide the user with an explanation of what is about to happen.
Currently if Google Fit is not installed, calling
health.isAvailable()
will open the Google Play Store to allow the user to install Google Fit. This is problematic in my application because we want to determine if Google Fit is available and then from there decide what to show the user with regards to options for enabling Google Fit integration. Checking for availability should be a separate method from helping the user install Google Fit. Alternatively, the same methodisAvailable()
could be used, but an optional parameter could be used to determine whether to open the Google Play Store if the package is not installed.The text was updated successfully, but these errors were encountered: