jlyman / react-native-rating-requestor Goto Github PK
View Code? Open in Web Editor NEWA React Native component to prompt users for a rating after positive interactions
License: MIT License
A React Native component to prompt users for a rating after positive interactions
License: MIT License
The url used on the showRatingDialog
is outdated and no longer works on iOS 11.
showRatingDialog(callback = () => {}) {
let storeUrl = Platform.OS === 'ios' ?
'http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=' + _config.appStoreId + '&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8' :
'market://details?id=' + _config.appStoreId;
.
.
.
Following this discussion on stack overflow, we should update the iOS url to follow the following format:
https://itunes.apple.com/us/app/appName/idAPP_ID?mt=8&action=write-review
.
So far as I could test it, this format works on both iOS 11 and 10.
If it's ok, I'm creating a PR with this change
The code uses button ordering for Android ie. [bottom, middle, top]. On iOS the button ordering for alert is [top, middle, bottom] so the accept
button is at the bottom which doesn't make much sense from a UX point of view. You want the desirable button to be at the top and the least desirable at the bottom.
There should be a platform check to reverse the order of buttons based on iOS vs Android.
There is a peerDependency for https://github.com/oblador/react-native-store-review set to
"react-native-store-review": "^0.1.5"
But in the latest version, that library has deprecated an all important method used by the current version of this library, called StoreReview.isAvailable
if (Platform.OS === 'ios' && StoreReview.isAvailable) {
StoreReview.requestReview();
}
In 0.3.0 they removed the method:
BREAKING CHANGE: Drop support for Android <21 & iOS < 12.4, and remove isAvailable constant.
So StoreReview.isAvailable
will return undefined, and that "if" statement will never succeed. Therefore, this never gets called:
StoreReview.requestReview();
For me, the fix was to do a patch and remove the call to isAvailable
:
diff --git a/node_modules/react-native-rating-requestor/index.js b/node_modules/react-native-rating-requestor/index.js
index 7f87cc3..3dfded5 100644
--- a/node_modules/react-native-rating-requestor/index.js
+++ b/node_modules/react-native-rating-requestor/index.js
@@ -121,7 +121,7 @@ export default class RatingRequestor {
RatingsData.recordRated();
callback(true, "accept");
// This API is only available on iOS 10.3 or later
- if (Platform.OS === 'ios' && StoreReview.isAvailable) {
+ if (Platform.OS === 'ios') {
StoreReview.requestReview();
} else {
Linking.openURL(this.storeUrl);
iOS shows all 3 options. Issue only happens on Android.
Apple is mandating all apps to drop custom rating dialogs in iOS 11 and use SKStoreReviewController
, so we'll need to switch to using that on iOS. This would be a net positive anyway (though slightly less flexible than what's already in place).
I see some comments that would be available in version 2.0.0 but I don't find anything about it in the docs
Since this doesn't seem to be maintained anymore — Is anyone using a reliable fork of this? I am thinking of using this one:
https://github.com/rizzomichaelg/react-native-rating-requestor/
Just like we've done for the iOS side of the fence with the native review screen, Google recently introduced their own for the Android side. Here's the details:
https://developer.android.com/guide/playcore/in-app-review
If anyone wants to work on this and open a PR that'd be amazing. :)
Nice, would be great to see Android support!
Is there any way to handle user decision ?
Hi,
I'm getting an error when I try to initialize RatingRequestor. I'm putting the following code in my index.ios.js
import RatingRequestor from 'react-native-rating-requestor'
let RatingTracker = new RatingRequestor('[my app id]')
And I get the following error when trying to run my app:
RatingRequestor is not a constructor
Any help is greatly appreciated. Thanks!
It works fine on IOS, but on android I get an error when I try to rate the app:
"To view this content install and set up a web browsing app".
I guess it has something to do with:
https://www.reddit.com/r/Android/comments/7lv04m/google_play_now_intercepts_all_links_to_the/
I cannot tell whether this plugin supports iOS 10.3+ feature of in-app reviews. If not, can we have this support?
Hello,
I try to call timingFunction, but it's not working. Please see code below.
import RatingRequestor from "react-native-rating-requestor";
const RatingTracker = new RatingRequestor(
Platform.select({
ios: 'xxxxxxxxx',
android: 'app.xxx',
}), {
shouldBoldLastButton: true,
timingFunction: function(currentCount) {
return currentCount > 1 && Math.log(currentCount) / Math.log(3) % 1 == 0;
}
});
This looks like a great module. I would like to keep the style of my app and want to use my own prompt/dialog. Is there a way to know when it's time to show my own dialog and methods I can call depending on which button the user presses?
Hi!
I see that this lib supports iOS and android but fail to see how to use both in the docs. I just want to confirm that the lib expects me to have some sort of platform specific code for iOS and android and call the lib separately (?). It's what I'd understand atm.
Also, since I assume that by default the lib will redirect to the app store / g play sites, is there any way to take the user immediately to the rating section instead of just the product page?
Thanks again for working on this :-)
Joan
What is this and where to get this? Apple or Android?
When I try and update react-native-store-review 0.1.5 → 0.2.0
I get:
Could not resolve dependency:
npm ERR! peer react-native-store-review@"^0.1.5" from [email protected]
It seems a peer version update is required.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.