当前位置:K88软件开发文章中心编程语言APP编程iOS → 文章内容

iOS应用内购买

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-23 13:42:25

t>0) { validProducts = response.products; validProduct = [response.products objectAtIndex:0]; if ([validProduct.productIdentifier isEqualToString:kTutorialPointProductID]) { [productTitleLabel setText:[NSString stringWithFormat: @"Product Title: %@",validProduct.localizedTitle]]; [productDescriptionLabel setText:[NSString stringWithFormat: @"Product Desc: %@",validProduct.localizedDescription]]; [productPriceLabel setText:[NSString stringWithFormat: @"Product Price: %@",validProduct.price]]; } } else { UIAlertView *tmp = [[UIAlertView alloc] initWithTitle:@"Not Available" message:@"No products to purchase" delegate:self cancelButtonTitle:nil otherButtonTitles:@"Ok", nil]; [tmp show]; } [activityIndicatorView stopAnimating]; purchaseButton.hidden = NO;}@end 注意: 需要修改你创建In-App Pur(应用内购买)的 kTutorialPointProductID 。通过修改fetchAvailableProducts产品标识符的 NSSet, 你可以添加多个产品。 输出 运行该应用程序,输出结果如下 确保已经中登录。单击购买选择现有的Apple ID。输入有效的测试帐户的用户名和密码。几秒钟后,显示下面的信息 一旦产品成功购买,将获得以下信息。可以在显示此信息的地方,更新应用功能相关的代码

上一页  [1] [2] 


iOS应用内购买