dpa99c / cordova-launch-review

Cordova/Phonegap plugin for iOS and Android to assist in leaving user reviews/ratings in the App Stores
71 stars 26 forks source link

Simplify the API: detect appId automatically #4

Closed pke closed 6 years ago

pke commented 7 years ago

I think at least in Android it would be possible to detect the bundle ID automatically. It is equal to the config.xml value. For iOS apps its a little bit more difficult, as we only have the [NSBundle mainBundle].bundleIdentifier.

Also couldn't we get rid of the separate inAppRating functions for iOS and instead use a unified rate function that:

  1. Detects the running appId automatically
  2. Opens the app store to rate the app or displays the inApp review if possible and specified as an option inApp: true.

Then there is no boilerplate code needed in the app. We would have to decide on the default value of inApp option. I think it should be true so that newer iOS versions always show the inApp rating. In case the developer always wants the user to go to the store to rate she would have to set it to false.

What do you think?

dpa99c commented 7 years ago

This plugin (like all of mine) arose out of necessity when building a Cordova app which required the functionality. So the API could definitely be more elegant and it should be possible to automatically detect the bundle ID.

This would be a backwardly-incompatible change to the API, so as well as a major version bump, the release would need to be co-ordinated, for example with Ionic Native which provides a Typescript wrapper for this plugin.

Also couldn't we get rid of the separate inAppRating functions for iOS and instead use a unified rate function

Not sure about this, since the in-app rating dialog is not equivalent to launching the App Store page, since it only allows you to leave a rating, not a review. Currently launch() has consistent cross-platform behaviour in that it allows you to launch the corresponding app store and leaving both a rating and review. The iOS-only rating() allows you to leave only a rating. For my own apps, I prefer to encourage users to leave a review as well as a rating.

dpa99c commented 6 years ago

Finally got around to this. v3 of the plugin should now automatically detect the app ID to use for the App Store URLs if not explicitly specified. Note the major version bump due to backwardly-incompatible API changes.