pushandplay / cordova-plugin-apprate

This plugin provide the "rate this app" functionality into your Cordova/Phonegap application
Apache License 2.0
300 stars 190 forks source link

1.7.1 does not work with Ionic #296

Open Crypt0Graphic opened 3 years ago

Crypt0Graphic commented 3 years ago

I had trouble all day with this version.

First when i click to rate, opens a popup and says "cannot connect itunes store".

I tried different settings but settings changed NOTHING. For example i tried simpleMode = true but it worked as default or i changed customLocale, nothing changed.

When i downgraded to -one year- 1.5.0 version everything worked fine.

Ionic CLI: 6.12.2 Cordova: 10.0.0

copaste commented 3 years ago

I even can't run it. Ionic can't find it and I can see the warning in the console log: Install the App rate plugin: 'ionic cordova plugin add cordova-plugin-apprate' I downgraded to 1.5.0 as well and everything works now.

stfnwbr commented 3 years ago

After hours struggling with the same problem I found this issue. Downgrade to 1.5.0 did the trick for me also. Working as expected with 1.5.0 now.

Mobiletainment commented 3 years ago

I had the same issue, but Instead of reverting back to 1.5.0, I was able to simply use version 1.6.1 for now which has the new reviewType InAppReview available.

dmi3lab commented 3 years ago

For those who is receiving "cannot connect itunes store" error and using Ionic:

After debugging in xCode I realized that appID wasn't picked up from preferences and appeared as Null in xCode. This eventually is not a plugin problem but rather misleading outdated Ionic documentation. If you followed Ionic documentation for this plugin (as I initially did) and used direct object's preferences property assignment like this:

this.appRate.preferences.storeAppURL = {
  ios: '<app_id>'
}

then take a look to this project's documentation for appropriate initialization. You need to use setPreferences method that was introduced in 1.7.0. It appears to be a breaking change. At least when it comes to usage with Ionic. Here is the PR that introduced this change: #286

Changing the code listed above to the following form fixed the problem for me:

this.appRate.setPreferences({
  storeAppURL = {
    ios: '<app_id>'
  }
});