RateBox  3.0
PaperPlaneTools.RateBox Class Reference

RateBox asset main class More...

Public Member Functions

void Init (string rateUrl, RateBoxConditions conditions=null, RateBoxTextSettings textSettings=null)
 Disclaimer: Call Init function only if you don't use RateBoxPrefab. Otherwise RateBoxPrefab script will call Init for you with arguments from the inspector. Call Init after the application is launched, or when it returns from a background state in order to increment session counter correctly. More...
 
void Show (string title, string message, string rateButtonTitle, string postponeButtonTilte, string rejectButtonTitle=null)
 Show a rate dialog if all restrictions are met. Restrictions are set when calling Init function with conditions argument != null Disclaimer: DefaultTextSettings will be totally ignored More...
 
void Show ()
 Basically function does the same as Show function with arguments, but takes arguments from DefaultTextSettings. Usually PaperPlaneTools.RateBox.DefaultTextSettings is set automatically if using RateBoxPrefab, but PaperPlaneTools.RateBox.DefaultTextSettings also can be set directly in code More...
 
void ForceShow (string title, string message, string rateButtonTitle, string postponeButtonTilte, string rejectButtonTitle=null)
 Show a rate dialog without checking any restrictions. Designed to show a rate dialog from game settings menu. Doesn't affect postpone cooldown, even if user press postponeButtonTilte button. However, if the user press rateButtonTitle or rejectButtonTitle buttons the dialog will not be displayed again after calling Show function. Disclaimer: PaperPlaneTools.RateBox.DefaultTextSettings will be totally ignored. More...
 
void ForceShow ()
 Basically function does the same as ForceShow function with arguments, but takes arguments from DefaultTextSettings. Usually PaperPlaneTools.RateBox.DefaultTextSettings is set automatically if using RateBoxPrefab, but PaperPlaneTools.RateBox.DefaultTextSettings also can be set directly in code More...
 
void IncrementCustomCounter (int value=1)
 Increments the custom counter. Call IncrementCustomCounter to increment the counter if MinCustomEventsCount restriction is greater than 0 More...
 
bool CheckConditionsAreMet ()
 Check all restrictions. Call CheckConditionsAreMet function to predict if Show would prompt a rate dialog More...
 
void ClearStatistics ()
 Clears the statistics Normally this function is called automatically when new app's version is detected. However, it can be handy to use it for test purpose. Important: It is not a good idea to clear statistics in release version of the applications More...
 
bool SaveStatistics ()
 Permanently saves Statistics. It's really rare when Statistics is manupulated outside the RateBox class, and I would not recomend you to do so without a strong reason. However, if you have such reason call SaveStatistics after you've changed Statistic to store it permanently More...
 

Static Public Member Functions

static string GetStoreUrl (string iTunesAppId, string googlePlayMarketAppBundleId)
 Return store url for the app. This function is only for your convenience and designed to work with AppStore and Google Play. If you need more complex behaviour, for example your app supports Amazone Store you should not use this function, but create the new one. Note: In Unity Editor return AppStore url More...
 

Properties

static RateBox Instance [get]
 Singleton for RateBox instance More...
 
bool DebugMode [get, set]
 Turn on debug to report conditions check log. This will help to understand why Rate dialog doesn't appear after calling Show method Default value is false, however if in Unity Editor environment default value is true Can be set directly in code or automatically if using RateBoxPrefab ('Log Debug Message' field) More...
 
string RateUrl [get, set]
 http(s) url to open after user press the Rate button. In most cases the url from PaperPlaneTools.RateBox.GetStoreUrl function will met your requirements. Can be set directly in code, or after calling init function, or automatically if using RateBoxPrefab ('App Store App Id' and 'Play Market App Bundle Id' fields) More...
 
RateBoxConditions Conditions [get, set]
 The set of conditions under which rate dialog is presented. If any requirements are not met, calling Show is ignored. This is useful when you want to limit number of rate dialog impressions. Can be set directly in code, or after calling init function, or automatically if using RateBoxPrefab ('DISPLAY CONDITIONS' group) For more information check PaperPlaneTools.RateBoxConditions class More...
 
RateBoxStatistics Statistics [get]
 Holds statistics which RateBox rely on when check PaperPlaneTools.RateBox.Conditions. For more information check PaperPlaneTools.RateBoxStatistics class More...
 
RateBoxTextSettings DefaultTextSettings [get, set]
 Holds strings (like title, message etc) to use when call Show() or ForceShow() functions without arguments Can be set directly in code, or automatically if using RateBoxPrefab ('TEXT' group) For more information check PaperPlaneTools.RateBoxTextSettings class More...
 
IAlertPlatformAdapter AlertAdapter [get, set]
 This adapter will be used to show Alert By default is null, which means native alert window will be used If you want to show your custom designed window you need to implement IAlertPlatformAdapter More...
 

Detailed Description

RateBox asset main class

Member Function Documentation

§ CheckConditionsAreMet()

bool PaperPlaneTools.RateBox.CheckConditionsAreMet ( )

Check all restrictions. Call CheckConditionsAreMet function to predict if Show would prompt a rate dialog

§ ClearStatistics()

void PaperPlaneTools.RateBox.ClearStatistics ( )

Clears the statistics Normally this function is called automatically when new app's version is detected. However, it can be handy to use it for test purpose. Important: It is not a good idea to clear statistics in release version of the applications

§ ForceShow() [1/2]

void PaperPlaneTools.RateBox.ForceShow ( string  title,
string  message,
string  rateButtonTitle,
string  postponeButtonTilte,
string  rejectButtonTitle = null 
)

Show a rate dialog without checking any restrictions. Designed to show a rate dialog from game settings menu. Doesn't affect postpone cooldown, even if user press postponeButtonTilte button. However, if the user press rateButtonTitle or rejectButtonTitle buttons the dialog will not be displayed again after calling Show function. Disclaimer: PaperPlaneTools.RateBox.DefaultTextSettings will be totally ignored.

Parameters
titleTitle of the dialog
messageMessage
rateButtonTitleRate button title. For example: "Rate"
postponeButtonTiltePostpone button title. For example: "Later"
rejectButtonTitleReject button title. If null, third button is not shown. For example: "Never" for 3-buttons dialog, or null for 2-buttons dialog

§ ForceShow() [2/2]

void PaperPlaneTools.RateBox.ForceShow ( )

Basically function does the same as ForceShow function with arguments, but takes arguments from DefaultTextSettings. Usually PaperPlaneTools.RateBox.DefaultTextSettings is set automatically if using RateBoxPrefab, but PaperPlaneTools.RateBox.DefaultTextSettings also can be set directly in code

§ GetStoreUrl()

static string PaperPlaneTools.RateBox.GetStoreUrl ( string  iTunesAppId,
string  googlePlayMarketAppBundleId 
)
static

Return store url for the app. This function is only for your convenience and designed to work with AppStore and Google Play. If you need more complex behaviour, for example your app supports Amazone Store you should not use this function, but create the new one. Note: In Unity Editor return AppStore url

Returns
The Store URL.
Parameters
iTunesAppIdApp id from iTuncesConnect
googlePlayMarketAppBundleIdApp bundle identifier.

§ IncrementCustomCounter()

void PaperPlaneTools.RateBox.IncrementCustomCounter ( int  value = 1)

Increments the custom counter. Call IncrementCustomCounter to increment the counter if MinCustomEventsCount restriction is greater than 0

§ Init()

void PaperPlaneTools.RateBox.Init ( string  rateUrl,
RateBoxConditions  conditions = null,
RateBoxTextSettings  textSettings = null 
)

Disclaimer: Call Init function only if you don't use RateBoxPrefab. Otherwise RateBoxPrefab script will call Init for you with arguments from the inspector. Call Init after the application is launched, or when it returns from a background state in order to increment session counter correctly.

Parameters
rateUrlhttp(s) url to open after user press the Rate button.
conditionsThe set of conditions under which a rate dialog should be presented. If any requirements are not meet, calling Show will be ignored. This is useful when you want to limit number of rate dialog impressions. If null, default restrictions will be used. Check RateBoxConditions to learn about default values
textSettingsHolds strings (like title, message etc) to use when call Show() or ForceShow() functions without arguments Can be set directly in code, or automatically if using RateBoxPrefab ('TEXT' group) If null, you need to call Show and Force show with arguments; default functions will not work

§ SaveStatistics()

bool PaperPlaneTools.RateBox.SaveStatistics ( )

Permanently saves Statistics. It's really rare when Statistics is manupulated outside the RateBox class, and I would not recomend you to do so without a strong reason. However, if you have such reason call SaveStatistics after you've changed Statistic to store it permanently

§ Show() [1/2]

void PaperPlaneTools.RateBox.Show ( string  title,
string  message,
string  rateButtonTitle,
string  postponeButtonTilte,
string  rejectButtonTitle = null 
)

Show a rate dialog if all restrictions are met. Restrictions are set when calling Init function with conditions argument != null Disclaimer: DefaultTextSettings will be totally ignored

Parameters
titleTitle of the dialog
messageMessage
rateButtonTitleRate button title. For example: "Rate"
postponeButtonTiltePostpone button title. For example: "Later"
rejectButtonTitleReject button title. If null, third button is not shown. For example: "Never" for 3-buttons dialog, or null for 2-buttons dialog

§ Show() [2/2]

void PaperPlaneTools.RateBox.Show ( )

Basically function does the same as Show function with arguments, but takes arguments from DefaultTextSettings. Usually PaperPlaneTools.RateBox.DefaultTextSettings is set automatically if using RateBoxPrefab, but PaperPlaneTools.RateBox.DefaultTextSettings also can be set directly in code

Property Documentation

§ AlertAdapter

IAlertPlatformAdapter PaperPlaneTools.RateBox.AlertAdapter
getset

This adapter will be used to show Alert By default is null, which means native alert window will be used If you want to show your custom designed window you need to implement IAlertPlatformAdapter

§ Conditions

RateBoxConditions PaperPlaneTools.RateBox.Conditions
getset

The set of conditions under which rate dialog is presented. If any requirements are not met, calling Show is ignored. This is useful when you want to limit number of rate dialog impressions. Can be set directly in code, or after calling init function, or automatically if using RateBoxPrefab ('DISPLAY CONDITIONS' group) For more information check PaperPlaneTools.RateBoxConditions class

§ DebugMode

bool PaperPlaneTools.RateBox.DebugMode
getset

Turn on debug to report conditions check log. This will help to understand why Rate dialog doesn't appear after calling Show method Default value is false, however if in Unity Editor environment default value is true Can be set directly in code or automatically if using RateBoxPrefab ('Log Debug Message' field)

§ DefaultTextSettings

RateBoxTextSettings PaperPlaneTools.RateBox.DefaultTextSettings
getset

Holds strings (like title, message etc) to use when call Show() or ForceShow() functions without arguments Can be set directly in code, or automatically if using RateBoxPrefab ('TEXT' group) For more information check PaperPlaneTools.RateBoxTextSettings class

§ Instance

RateBox PaperPlaneTools.RateBox.Instance
staticget

Singleton for RateBox instance

§ RateUrl

string PaperPlaneTools.RateBox.RateUrl
getset

http(s) url to open after user press the Rate button. In most cases the url from PaperPlaneTools.RateBox.GetStoreUrl function will met your requirements. Can be set directly in code, or after calling init function, or automatically if using RateBoxPrefab ('App Store App Id' and 'Play Market App Bundle Id' fields)

§ Statistics

RateBoxStatistics PaperPlaneTools.RateBox.Statistics
get

Holds statistics which RateBox rely on when check PaperPlaneTools.RateBox.Conditions. For more information check PaperPlaneTools.RateBoxStatistics class


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