Added the possibility to open the app detail page in AppGallery #24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First of all, thank you for creating react-native-app-link.
It is used by many developers to open their apps' detail page on the App Store or the Play Store.
As you likely already know, the new Huawei Android-powered devices (starting from the P40 and Mate 30 Series) do not come with the Play Store preinstalled. This has lead to the increase in popularity of Huawei's own application store, called the AppGallery.
Many developers using your library might already have uploaded their applications to the AppGallery. It would be nice if these developers had the ability to redirect users to their app's detail page on the AppGallery as well.
The changes I made here will allow developers to additionally provide their app's "appGalleryId" to the maybeOpenURL() and openInStore() functions. If AppGallery is not installed on the user's Android device, the Play Store link will be opened instead.
If the developer does not provide the "appGalleryId" parameter, the Play Store link will be opened like before.
This is an approach that seems to work. I thought of other approaches, like checking which application stores are installed on the device to decide which application store to open, but that would require adding extra dependencies to react-native-app-link, which I tried to avoid.
Please let me know if you agree with this change or if you think it could be done better.