KjellConnelly / react-native-rate

Send your app users to Apple App Store, Google Play, Amazon, or other using the newest APIs
642 stars 101 forks source link

Question: Android packge name or ApplicationID #106

Open Sub-Zero-1 opened 2 years ago

Sub-Zero-1 commented 2 years ago

Hello,

there is some confusion in our project. You speak about a package name (GooglePackageName) which should be provided. Now, that is misleading. The package name is not the ApplicationId! http://tools.android.com/tech-docs/new-build-system/applicationid-vs-packagename So, a project can have a package name like: com.we.myproject and a ApplicationId like: com.we.mybestproject at the same time.

The ApplicationId is the identifier of the "app" in the Google PlayStore!

We wanted to correct this and provide the ApplicaitonId, but we see that since the use of react-native-rate we have received an immense increase in ratings and we are now asking ourselves what is the correct value to enter. Normally, no rating should be displayed with an incorrect ApplicationId.

What should be entered now? The ApplicationID or the package name? If it is the ApplicationID, why do we have a massive increase in ratings as we use the package name?

Sub-Zero-1 commented 2 years ago

As far as I understand the code it is only needed if the openAppStoreIfInAppFails or we do not use preferInApp. I suppose, we still need the ApplicationId and we saw App ratings (even with the package name, which is wrong), because we use preferInApp=true and the rating did not fail (openAppStoreIfInAppFails). Using the package name instead of the ApplicationId in case of an error (openAppStoreIfInAppFails) would mean, we would try to open a wrong URL. You still need to clarify it and correct it if necessary.

      if (options.preferredAndroidMarket === AndroidMarket.Google) {
        if (options.preferInApp) {
          RNRate.rate(options, (response, error)=>{
            if (!response) {
              if (options.openAppStoreIfInAppFails) {
                Rate.openURL(GooglePrefix + options.GooglePackageName, callback)
              } else {
                callback(false, error)
              }
            } else {
              callback(response, error)
            }
          })
        } else {
          Rate.openURL(GooglePrefix + options.GooglePackageName, callback)
        }