I have an android app , that i need to deploy for both Google play and App gallery
and it contains Ads and IAP , the problem is that
1- What is the correct way to handle the ads/purchase ?
if hmsAvailable() {
// use Huawei ads/iap
} else {
// use Google ads/iap
}
2- I need the same code base ,so Would it cause a problem to have both GMS and HMS inside Gradle.build ?
3- It seems that Huawei is about to prevent GMS installation on it's devices , so if a user has paid the premium IAP with a google account , would this means he can't restore it when GMS is blocked on Huawei ?
CodePudding user response:
I don't hear anything about blocking GMS by Huawei, but hear about blocking apps on google play if they have Huawei SDKs.
So, you should choose this way:
Create different flavors for different stores and include huawei/google libraries only for huawei/google flavor.
And yes, to restore iaps on different devices with different stores you have to store purchases info on your own server, not rely on response from store.
CodePudding user response:
1- What is the correct way to handle the ads/purchase ?
You can make a judgment, but it is recommended that Google Play and App Gallery integrate their own Ads and IAP SDKs, and include Huawei and Google libraries.
2- I need the same code base ,so Would it cause a problem to have both GMS and HMS inside Gradle.build ?
On Google Play, only apps integrated with the Google IAP can be released. If the apps integrated with the HMS, the apps cannot be released.
There are no restrictions on Huawei App Gallery.
3- It seems that Huawei is about to prevent GMS installation on it's devices , so if a user has paid the premium IAP with a google account , would this means he can't restore it when GMS is blocked on Huawei ?
It is not that Huawei prevents the installation of the GMS, but that the GMS cannot be installed on Huawei devices.