言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

Windows.LicenseInformation.PurchaseApp

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static function PurchaseApp(): string;
public static string PurchaseApp();
public static def PurchaseApp() as string

Description

Attempts to purchase the app if it is in installed in trial mode. This API is supported only on Windows Phone 8 and Windows Store Apps.

Behaviour on Windows Phone 8: Redirects the user to application page on the Store. Returns an empty string. You can use isOnAppTrial afterwards to find out whether the user bought the application. Behaviour on Windows Store Apps: Pops up a dialog for a user asking whether he wants to buy the application. If use buys an app, returns a valid purchase receipt string. Otherwise, returns an empty string.

var m_Receipt : string;
function OnGUI () {
	if (LicenseInformation.isOnAppTrial) {
		if (GUI.Button (Rect (10, 10, 100, 40), "Buy full version")) {
			m_Receipt = LicenseInformation.PurchaseApp ();
		}
	} else {
		GUI.Label (Rect (10, 10, 100, 40), "You have full application version installed");
	}
}
no example available in C#
no example available in Boo