Pop-ups and Pre-loaders

OSX Message

To show the message we should create an OSXMessage object.  OSXMessage has 2 constructors:

public static void Create(string title, string message)
public static void Create(string title, string message, string ok)

Example:

OSXMessage.Create("Message Titile", "Message message");

 

OSXDialog

The OSXDialog object also has 2 constructors:

public static OSXDialogResult Create(string title, string message)
public static OSXDialogResult Create(string title, string message, string yes, string no)

 

With OSXDialog we can find out not only when the dialog was closed, but also the user reply.

Example:

OSXDialogResult result = OSXDialog.Create("Dialog Titile", "Dialog message");

//parsing result
switch(result) {
	case OSXDialogResult.YES:
			Debug.Log ("Yes button pressed");
			break;
	case OSXDialogResult.NO:
			Debug.Log ("No button pressed");
			break;

}

OSXMessage.Create("Result", result.ToString() + " button pressed");

 

OSXRateUsPopUp

The rate popup is commonly used to prompt the user to rate your app. If the user presses the "Rate" button he will be redirected to the App Store page of your app. If your app is not yet released, you will see a blank page.

With OSXRateUsPopUp you will be able to find out user reply, but you cannot find out which user rated your app or get the actual rating given.

NOTE: Rewarding users for rating is restricted by App Store rules.

The OSXRateUsPopUp  class has following constructors:

public static OSXRateResult Create()
public static OSXRateResult Create(string title, string message)
public static OSXRateResult Create(string title, string message, string rate, string remind, string declined)

 

Use Example:

OSXRateResult result = OSXRateUsPopUp.Create("Like this game?", "Please rate to support future updates!");

switch(result) {
	case IOSDialogResult.RATED:
		Debug.Log ("Rate button pressed");
		break;
	case IOSDialogResult.REMIND:
		Debug.Log ("Remind button pressed");
		break;
	case IOSDialogResult.DECLINED:
		Debug.Log ("Decline button pressed");
		break;
			
}

OSXMessage.Create("Result", result.ToString() + " button pressed");

 

 

You also can redirect the user to the App Store page of your app using:

OSXNativeUtility.RedirectToAppStoreRatingPage();

 

Pre-Loader

Native pre-loader can be used pretty simple. Use this code to show the preloader:

OSXNativeUtility.ShowPreloader();

 

It can be dismissed with single function call.

OSXNativeUtility.HidePreloader();

 

NOTE: The user input is disabled while the preloader is on the screen.

You can find an example of the described API in PopUpExamples.cs.