-
Notifications
You must be signed in to change notification settings - Fork 1
Rate Us Dialog
levching edited this page Apr 15, 2020
·
3 revisions
This guide show's how to make a common Rate Us Dialog with the Native Dialogs API.
In the example below we not only will create a dialog with 3 buttons bit also set up a listener to redirect a user to the marked to allow him to rate our app.
Please note that there is no way to get a callback if the user sets a rating to your app or now. You also should not reward a user based on his decision to rate your app or not. This is maybe a reason for Google to restrict your application in the market.
See the code snippet below:
using SA.Android.App;
using SA.Android.Content;
...
string appName = Application.productName;
string appIdentifier = Application.identifier;
var dialog = new AN_AlertDialog(AN_DialogTheme.Default);
dialog.Title = string.Format("Rate {0}!", appName);
dialog.Message = string.Format("If you enjoy using {0}, please take a moment to rate it.Thanks for your support!", appName);
dialog.SetNegativeButton("No, thanks", () => {
AN_Logger.Log("dialog: No, thanks button was clicked");
});
dialog.SetNeutralButton("Remind me later", () => {
AN_Logger.Log("dialog: Remind me later button was clicked");
});
dialog.SetPositiveButton("Rate", () => {
AN_Logger.Log("dialog: Rate button was clicked");
//This code will take user to your app Play Market page
System.Uri uri = new System.Uri("market://details?id=" + appIdentifier);
AN_Intent viewIntent = new AN_Intent(AN_Intent.ACTION_VIEW, uri);
AN_MainActivity.Instance.StartActivity(viewIntent);
});
dialog.Show();
Reliable and high-quality Unity Development service. Let's Talk!
Website | AssetStore | LinkedIn | Youtube | Scripting Reference
- Build Info
- Dark Mode
- Package Info
- Runtime Permissions
- Run External App
- Immersive Mode
- PackageManager
- Popups & Preloaders
- Rate Us Dialog
- Activity
- Intent
- Settings Page
- Media Player
- Date Picker Dialog
- Time Picker Dialog
- Locale
- Wheel Picker Dialog
- Developer Console Setup
- Connecting to The Service
- Purchase Flow
- Transactions Validation
- Subscriptions
- Licensing
- Getting Started
- Games Sing-in
- Server-side API Access
- Leaderboards
- Achievements
- Saved Games
- Image Manager
- Settings Intent