- Home /
How do I put a "Rate game" button?
I want to have a button on the start screen, that when pressed will get the player to the game's page in order for the player to rate it. Could anyone please guide me on how this is done? Thanks :-)
Answer by Bovine · Aug 18, 2011 at 09:02 PM
I don't know if there's anything in Unity, but you could write a simple plugin to do the native iOS code - given you said iTunes I'm presuming an iOS app?
The Unity Manual covers native code plugin creation here:
http://unity3d.com/support/documentation/Manual/Plugins.html
This page discusses the code for opening a URL:
http://iphonedevelopertips.com/cocoa/launching-the-browser-from-within-an-iphone-application.html
This page discusses a pure native code example:
http://www.sysapps.com/tutorials/2011/4/18/how-to-ask-a-user-to-rate-your-application.html
Thanks Bovine, sorry it took me a long time to return to this question :-)
Answer by AndreasBoye · Jul 30, 2014 at 10:27 AM
I'm probably a bit late to the party, but why not do something like this:
#if UNITY_ANDROID
Application.OpenURL("market://details?id=YOUR_ID");
#elif UNITY_IPHONE
Application.OpenURL("itms-apps://itunes.apple.com/app/idYOUR_ID");
#endif
Seems like that is what most people do.
Hey schwertfisch,
This is how you do it, Create a Rate button however you like, unity GUI or external plugins, and call this function containing AndreasBoye's code, on button click. That should do.
I'll tell you what helped me with my game, I used this free plugin called polljoy(polljoy.com), for the rate game popUp, and handled the AndreasBoye's code upon user feedback. SO I created a popup to redirect them to the app store. And the good thing is that usually they do it because they get rewarded. We use that a lot, easy to integrate.
And by the way, this website is pretty cool for inspiration regarding your button’s design : http://www.webdesignalley.org/button-design/splendid-set-of-game-buttons-design
Answer by usalalas · Mar 17, 2016 at 02:38 PM
Good morning to all,
How do I know the player actually rated the game? So I can stop asking him to rate it.
You can't know if the user actually rated your app after being redirected from your game to the App / Play Store, but you can check in Unity if user was redirected. So, after redirecting the user, use something simple like this:
if (PlayerPrefs.GetInt("hasRated", 0) == 0)
{
// Redirect user to Rate page
PlayerPrefs.SetInt("hasRated", 1);
}
Answer by cfbevan · Aug 18, 2011 at 09:09 PM
The following will open a browser to the page you need.
if(GUILayout.Button("TEXT")) {
Process pr = new Process();
pr.StartInfo.FileName = "http://WHERETO";
pr.StartInfo.Arguments = "";
pr.StartInfo.UseShellExecute = true;
pr.StartInfo.RedirectStandardOutput = false;
pr.Start();
}
I have tried this and while it works fine in the Editor it does not work on the phone. That presumes this is an iOS app - are OSX apps on iTunes or just in the OSX App Store?
Answer by dustylock · Dec 06, 2016 at 01:52 PM
Check out the asset https://goo.gl/fjziCh .
It will save you tons of time.