Closed pke closed 6 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.
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.
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: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 betrue
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 tofalse
.What do you think?