UniRate
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
UniRate Class Reference

The core class of UniRate. UniRate is a drop-in solution for rating prompt in Unity3D mobile game for iOS and Android. More...

Inheritance diagram for UniRate:

Public Types

enum  Error { Error.BundleIdDoesNotMatchAppStore, Error.AppNotFoundOnAppStore, Error.NotTheLatestVersion, Error.NetworkError }
 

Public Member Functions

delegate void OnUniRateFaildDelegate (UniRate.Error error)
 
delegate void OnDetectAppUpdatedDelegate ()
 
delegate bool ShouldUniRatePromptForRatingDelegate ()
 
delegate void OnPromptedForRatingDelegate ()
 
delegate void OnUserAttemptToRateDelegate ()
 
delegate void OnUserDeclinedToRateDelegate ()
 
delegate void OnUserWantReminderToRateDelegate ()
 
delegate bool ShouldUniRateOpenRatePageDelegate ()
 
bool ShouldPromptForRating ()
 Check the conditions to determine UniRate should show the prompt for rating. More...
 
void PromptIfNetworkAvailable ()
 Make a prompts if network available. More...
 
void ShowPrompt ()
 Shows the prompt, there is no check for conditions or app information getting. It depends on appStoreID, if you are not set it yourself, do not use this metod (use PromptIfNetworkAvailable instead). More...
 
void LogEvent (bool withPrompt)
 Log a event. The eventCount will be increased by calling this method. More...
 
void Reset ()
 Reset the UniRate. More...
 

Public Attributes

int appStoreID
 The AppStore ID for the app. This is needed to be set only if you want specify your app id youself. Normally, UniRate will try to get your app id by query from Apple, so you are likely to not set it. More...
 
string marketPackageName
 The market package name of Android app. This is needed to be set only if you want specify your app id youself. Normally, UniRate will try to get your market package name from the package info, so you are likely to not set it. More...
 
UniRateMarketType marketType
 The market you want UniRate to go. You can select from Google Play Market or Amazon Appstore. UniRate will handle the correct rating url for the market you selected. More...
 
string appStoreCountry
 The AppStore country code. This is needed to be set only if your app is not available in worldwide. Normally, UniRate will try to get the country code from user's phone setting and use it in querying app info You are likely to not set it yourself expect you are sure what to do. More...
 
string applicationName
 The name of the application. This is needed to be set only if you want specify your app name showed in prompt different from your app's real name. Normally, UniRate will try to get the app name form the app's info, so you are likely to not set it. More...
 
string applicationVersion
 The application version. Each new version will reset the use counting. Normally, UniRate will try to get the app version form the app's info, so you are likely to not set it. More...
 
string applicationBundleID
 The application bundle ID for iOS app, which is in a form of "com.companyName.productionName". This is needed to be set only if you want specify your app bundle ID. Normally, UniRate will try to get the app bundle ID form the app's info, so you are likely to not set it. More...
 
int usesUntilPrompt = 10
 The uses count until prompt. UniRate will not prompt when usesCount less than it. More...
 
int eventsUntilPrompt = 0
 The events count until prompt. UniRate will not prompt when eventCount less than it. More...
 
float daysUntilPrompt = 3.0f
 The days until prompt. UniRate will not prompt when usedDays less than it. More...
 
float usesPerWeekForPrompt = 0.0f
 The uses per week for prompt. UniRate will not prompt when usesPerWeek less than it. More...
 
float remindPeriod = 1.0f
 The remind period. When user required a remind, UniRate will prompt again after this period of time (day). More...
 
string messageTitle = ""
 The title of prompt alert. You may wish to customise this. More...
 
string message = ""
 The message of prompt alert. You may wish to customise this. More...
 
string cancelButtonLabel = ""
 The cancel button label of prompt alert. You may wish to customise this. More...
 
string remindButtonLabel = ""
 The remind button label of prompt alert. You may wish to customise this. More...
 
string rateButtonLabel = ""
 The rate button label of prompt alert. You may wish to customise this. More...
 
bool onlyPromptIfLatestVersion = true
 If true, only prompt if the running version is the latest version in AppStore. This is only available in iOS. Because there is no officail version check API for Android market More...
 
bool promptAgainForEachNewVersion = true
 If ture, each new version will count and prompts for rating. More...
 
bool promptAtLaunch = true
 If ture, UniRate will try to prompt at app launch finished if all conditions are met. More...
 
bool useCustomizedPromptView = false
 If ture, UniRate will not pop up a system style prompt alert view(dialog). If you set it to ture, you should implement the OnPromptedForRating event and send the button tap message back to UniRate for properly handle. More about customized prompt view, see the demo of UniRateEventHandler's OnPromptedForRating method. More...
 
bool previewMode = false
 The preview mode. If true, UniRate will prompt every time. You can use it for debugging. Remember to turn it off when release! More...
 

Properties

string MessageTitle [get]
 Gets the messageTitle. If not set, UniRate will use the default value. More...
 
string Message [get]
 Gets the message. If not set, UniRate will use the default value. More...
 
string CancelButtonLabel [get]
 Gets the cancelButtonLabel. If not set, UniRate will use the default value. More...
 
string RemindButtonLabel [get]
 Gets the remindButtonLabel. If not set, UniRate will use the default value. More...
 
string RateButtonLabel [get]
 Gets the rateButtonLabel. If not set, UniRate will use the default value. More...
 
string RatingIOSURL [get]
 Gets the iOS rating URL. In most case it will be generated automaticlly by your setting. If you set _ratingIOSURL yourself, the set value will be returned. More...
 
string RatingAndroidURL [get]
 Gets the Android rating URL. In most case it will be generated automaticlly by your setting. If you set _ratingAndroidURL yourself, the set value will be returned. More...
 
DateTime firstUsed [get, set]
 Gets or sets the time when current version is first used. More...
 
DateTime lastReminded [get, set]
 Gets or sets the time when last reminded happened. More...
 
int usesCount [get, set]
 Gets or sets the uses count. Every time the user open app (fresh start or switch from background), this count will be increased by 1. More...
 
int eventCount [get, set]
 Gets or sets the event count. You can record the event by calling LogEvent More...
 
float usesPerWeek [get]
 Gets the uses per week. More...
 
bool declinedThisVersion [get, set]
 Gets or sets a value indicating whether rating prompt for this version is declined. More...
 
bool declinedAnyVersion [get]
 Gets a value indicating whether rating prompt for any version is declined. More...
 
bool ratedThisVersion [get, set]
 Gets or sets a value indicating whether this version is already rated. More...
 
bool ratedAnyVersion [get]
 Gets a value indicating whether any version of the app is already rated. More...
 
float usedDays [get]
 Gets the used days. More...
 
bool waitingByRemindLater [get]
 Gets a value indicating whether the user want to remind and UniRate is waiting for next prompt time. More...
 
float leftRemindDays [get]
 Gets the left remind days. More...
 
static UniRate Instance [get]
 Gets the instance of the UniRate. If there is not an instance, UniRate will generate a gameObject "UniRateManager" in current scene. The instance game object will not be destroyed when load new scene. More...
 

Events

OnUniRateFaildDelegate OnUniRateFaild
 Occurs when there is an error during getting app info. A UniRate.Error will be sent. More...
 
OnDetectAppUpdatedDelegate OnDetectAppUpdated
 Occurs when the app is updated. All count (used count, days count, etc) was reseted. More...
 
ShouldUniRatePromptForRatingDelegate ShouldUniRatePromptForRating
 UniRate asks if it should pop a prompt when it wants to show a prompt. More...
 
OnPromptedForRatingDelegate OnPromptedForRating
 Occurs when it is the time to prompt for rating and UniRate is going to make a prompt alert view(dialog). More...
 
OnUserAttemptToRateDelegate OnUserAttemptToRate
 Occurs when user tapped "Rate" button in the prompt alert. More...
 
OnUserDeclinedToRateDelegate OnUserDeclinedToRate
 Occurs when user tapped "Cancel" button in the prompt alert. More...
 
OnUserWantReminderToRateDelegate OnUserWantReminderToRate
 Occurs when user tapped "Remind" button in the prompt alert. More...
 
ShouldUniRateOpenRatePageDelegate ShouldUniRateOpenRatePage
 UniRate asks if it should open the rate page when user clicked the Rate button. More...
 

Detailed Description

The core class of UniRate. UniRate is a drop-in solution for rating prompt in Unity3D mobile game for iOS and Android.

Member Enumeration Documentation

Enumerator
BundleIdDoesNotMatchAppStore 
AppNotFoundOnAppStore 
NotTheLatestVersion 
NetworkError 

Member Function Documentation

void UniRate.LogEvent ( bool  withPrompt)

Log a event. The eventCount will be increased by calling this method.

Parameters
withPromptIf set to true, a prompt will be generated immediately after the event logging.
delegate void UniRate.OnDetectAppUpdatedDelegate ( )
delegate void UniRate.OnPromptedForRatingDelegate ( )
delegate void UniRate.OnUniRateFaildDelegate ( UniRate.Error  error)
delegate void UniRate.OnUserAttemptToRateDelegate ( )
delegate void UniRate.OnUserDeclinedToRateDelegate ( )
delegate void UniRate.OnUserWantReminderToRateDelegate ( )
void UniRate.PromptIfNetworkAvailable ( )

Make a prompts if network available.

void UniRate.Reset ( )

Reset the UniRate.

bool UniRate.ShouldPromptForRating ( )

Check the conditions to determine UniRate should show the prompt for rating.

Returns
true, if should prompt for rating, false otherwise.
delegate bool UniRate.ShouldUniRateOpenRatePageDelegate ( )
delegate bool UniRate.ShouldUniRatePromptForRatingDelegate ( )
void UniRate.ShowPrompt ( )

Shows the prompt, there is no check for conditions or app information getting. It depends on appStoreID, if you are not set it yourself, do not use this metod (use PromptIfNetworkAvailable instead).

Member Data Documentation

string UniRate.applicationBundleID

The application bundle ID for iOS app, which is in a form of "com.companyName.productionName". This is needed to be set only if you want specify your app bundle ID. Normally, UniRate will try to get the app bundle ID form the app's info, so you are likely to not set it.

string UniRate.applicationName

The name of the application. This is needed to be set only if you want specify your app name showed in prompt different from your app's real name. Normally, UniRate will try to get the app name form the app's info, so you are likely to not set it.

string UniRate.applicationVersion

The application version. Each new version will reset the use counting. Normally, UniRate will try to get the app version form the app's info, so you are likely to not set it.

string UniRate.appStoreCountry

The AppStore country code. This is needed to be set only if your app is not available in worldwide. Normally, UniRate will try to get the country code from user's phone setting and use it in querying app info You are likely to not set it yourself expect you are sure what to do.

int UniRate.appStoreID

The AppStore ID for the app. This is needed to be set only if you want specify your app id youself. Normally, UniRate will try to get your app id by query from Apple, so you are likely to not set it.

string UniRate.cancelButtonLabel = ""

The cancel button label of prompt alert. You may wish to customise this.

float UniRate.daysUntilPrompt = 3.0f

The days until prompt. UniRate will not prompt when usedDays less than it.

int UniRate.eventsUntilPrompt = 0

The events count until prompt. UniRate will not prompt when eventCount less than it.

string UniRate.marketPackageName

The market package name of Android app. This is needed to be set only if you want specify your app id youself. Normally, UniRate will try to get your market package name from the package info, so you are likely to not set it.

UniRateMarketType UniRate.marketType

The market you want UniRate to go. You can select from Google Play Market or Amazon Appstore. UniRate will handle the correct rating url for the market you selected.

string UniRate.message = ""

The message of prompt alert. You may wish to customise this.

string UniRate.messageTitle = ""

The title of prompt alert. You may wish to customise this.

bool UniRate.onlyPromptIfLatestVersion = true

If true, only prompt if the running version is the latest version in AppStore. This is only available in iOS. Because there is no officail version check API for Android market

bool UniRate.previewMode = false

The preview mode. If true, UniRate will prompt every time. You can use it for debugging. Remember to turn it off when release!

bool UniRate.promptAgainForEachNewVersion = true

If ture, each new version will count and prompts for rating.

bool UniRate.promptAtLaunch = true

If ture, UniRate will try to prompt at app launch finished if all conditions are met.

string UniRate.rateButtonLabel = ""

The rate button label of prompt alert. You may wish to customise this.

string UniRate.remindButtonLabel = ""

The remind button label of prompt alert. You may wish to customise this.

float UniRate.remindPeriod = 1.0f

The remind period. When user required a remind, UniRate will prompt again after this period of time (day).

bool UniRate.useCustomizedPromptView = false

If ture, UniRate will not pop up a system style prompt alert view(dialog). If you set it to ture, you should implement the OnPromptedForRating event and send the button tap message back to UniRate for properly handle. More about customized prompt view, see the demo of UniRateEventHandler's OnPromptedForRating method.

float UniRate.usesPerWeekForPrompt = 0.0f

The uses per week for prompt. UniRate will not prompt when usesPerWeek less than it.

int UniRate.usesUntilPrompt = 10

The uses count until prompt. UniRate will not prompt when usesCount less than it.

Property Documentation

string UniRate.CancelButtonLabel
get

Gets the cancelButtonLabel. If not set, UniRate will use the default value.

The cancel button text. Default value is "No, Thanks"

bool UniRate.declinedAnyVersion
get

Gets a value indicating whether rating prompt for any version is declined.

true if declined any version; otherwise, false.

bool UniRate.declinedThisVersion
getset

Gets or sets a value indicating whether rating prompt for this version is declined.

true if declined this version; otherwise, false.

int UniRate.eventCount
getset

Gets or sets the event count. You can record the event by calling LogEvent

The event count.

DateTime UniRate.firstUsed
getset

Gets or sets the time when current version is first used.

The DateTime when first used.

UniRate UniRate.Instance
staticget

Gets the instance of the UniRate. If there is not an instance, UniRate will generate a gameObject "UniRateManager" in current scene. The instance game object will not be destroyed when load new scene.

The instance in the scene.

DateTime UniRate.lastReminded
getset

Gets or sets the time when last reminded happened.

The DateTime when last remind.

float UniRate.leftRemindDays
get

Gets the left remind days.

The days until next prompt.

string UniRate.Message
get

Gets the message. If not set, UniRate will use the default value.

The message body you set. Default value is "If you enjoy {<see cref="applicationName"/>}, would you mind taking a moment to rate it? It will not take more than a minute. Thanks for your support!"

string UniRate.MessageTitle
get

Gets the messageTitle. If not set, UniRate will use the default value.

The message title you set. Default value is "Rate {<see cref="applicationName"/>}"

string UniRate.RateButtonLabel
get

Gets the rateButtonLabel. If not set, UniRate will use the default value.

The rate button text. Default value is "Rate It Now"

bool UniRate.ratedAnyVersion
get

Gets a value indicating whether any version of the app is already rated.

true if any version rated; otherwise, false.

bool UniRate.ratedThisVersion
getset

Gets or sets a value indicating whether this version is already rated.

true if this version rated; otherwise, false.

string UniRate.RatingAndroidURL
get

Gets the Android rating URL. In most case it will be generated automaticlly by your setting. If you set _ratingAndroidURL yourself, the set value will be returned.

The rating Android URL.

string UniRate.RatingIOSURL
get

Gets the iOS rating URL. In most case it will be generated automaticlly by your setting. If you set _ratingIOSURL yourself, the set value will be returned.

The rating iOS URL.

string UniRate.RemindButtonLabel
get

Gets the remindButtonLabel. If not set, UniRate will use the default value.

The remind button text. Default value is "Remind Me Later"

float UniRate.usedDays
get

Gets the used days.

The used days.

int UniRate.usesCount
getset

Gets or sets the uses count. Every time the user open app (fresh start or switch from background), this count will be increased by 1.

The uses count.

float UniRate.usesPerWeek
get

Gets the uses per week.

The uses per week.

bool UniRate.waitingByRemindLater
get

Gets a value indicating whether the user want to remind and UniRate is waiting for next prompt time.

true if waiting waiting for next prompt time; otherwise, false.

Event Documentation

OnDetectAppUpdatedDelegate UniRate.OnDetectAppUpdated

Occurs when the app is updated. All count (used count, days count, etc) was reseted.

OnPromptedForRatingDelegate UniRate.OnPromptedForRating

Occurs when it is the time to prompt for rating and UniRate is going to make a prompt alert view(dialog).

OnUniRateFaildDelegate UniRate.OnUniRateFaild

Occurs when there is an error during getting app info. A UniRate.Error will be sent.

OnUserAttemptToRateDelegate UniRate.OnUserAttemptToRate

Occurs when user tapped "Rate" button in the prompt alert.

OnUserDeclinedToRateDelegate UniRate.OnUserDeclinedToRate

Occurs when user tapped "Cancel" button in the prompt alert.

OnUserWantReminderToRateDelegate UniRate.OnUserWantReminderToRate

Occurs when user tapped "Remind" button in the prompt alert.

ShouldUniRateOpenRatePageDelegate UniRate.ShouldUniRateOpenRatePage

UniRate asks if it should open the rate page when user clicked the Rate button.

ShouldUniRatePromptForRatingDelegate UniRate.ShouldUniRatePromptForRating

UniRate asks if it should pop a prompt when it wants to show a prompt.


The documentation for this class was generated from the following file: