包含此页的版本:
不含此页的版本:
当用户想要购买产品时,调用InitiatePurchase方法IStoreController,识别用户想要购买的产品。
// Example method called when the user presses a 'buy' button
// to start the purchase process.
public void OnPurchaseClicked(string productId) {
controller.InitiatePurchase(productId);
}
应用程序将异步收到结果通知,调用ProcessPurchase成功购买或OnPurchaseFailed对于失败。