ope*_*rog 21 iphone in-app-purchase ipad ios
我按照Ray Wenderlich教程书实现了一个简单的非消费类应用内购买机制.
当我的应用开始时,我发起了产品信息请求:
self.productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:productIdentifiers];
_productsRequest.delegate = self;
[_productsRequest start];
Run Code Online (Sandbox Code Playgroud)
SKProductRequest已创建.它有一个内存地址,但没有其他事情发生.没有调用任何委托方法:
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
NSLog(@"Product info received...");
NSArray *products = response.products;
for (SKProduct *product in products) {
NSLog(@"ID: %@, title:%@, (%f)", product.productIdentifier, product.localizedTitle, product.price.floatValue);
}
self.productsRequest = nil;
}
- (void)request:(SKRequest *)request didFailWithError:(NSError *)error {
NSLog(@"Failed to load list of products");
self.productsRequest = nil;
}
Run Code Online (Sandbox Code Playgroud)
我检了两次:
Ray Wenderlich的书中没有提到除此之外我还必须做任何其他事情.
只有一次我看到-didFailWithError:在设备上调用我的委托,但它再也没有出现过.我的代表在设备或模拟器上都没有被调用.我让它运行几分钟而没有任何反应.
iTunes Connect提供了这个令人困惑的警告:
您的首次应用程序内购买必须使用新的应用程序版本提交.从"版本详细信息"页面的"应用内购买"部分中选择它们,然后单击"准备上载二进制".
在测试应用程序内购买之前是否需要这样做?
yoo*_*ood 23
在当前版本的Xcode 5.0(5A1413)中,应用程序内购买将无法在iOS模拟器中运行.
StoreKit(应用程序内购买)将无法在模拟器中运行.13962338
来源:Xcode 5.0发行说明>已知问题> iOS模拟器https://developer.apple.com/library/ios/releasenotes/DeveloperTools/RN-Xcode/xc5_release_notes/xc5_release_notes.html#//apple_ref/doc/uid/TP40001051- CH2-SW303
Ash*_*bay 14
在iOS模拟器文档中,它写成:
API限制
在iOS模拟器中,API和功能存在一些限制,包括:
Run Code Online (Sandbox Code Playgroud)Apple Push Services Privacy alerts for access to Photos, Contacts, Calendar, and Reminders The UIBackgroundModes key iCloud document syncing and key-value storage support不受支持的框架包括:
Run Code Online (Sandbox Code Playgroud)External Accessory Media Player Message UI Event Kit In UIKit, the UIVideoEditorController class Store Kit
由于应用程序内购买需要Store Kit才能运行且Store Kit框架不支持Simulator,因此无法在iOS模拟器中测试IAP.
更多信息:iOS模拟器文档
不幸的是,有几件事你不能在模拟器上测试。应用内购买属于该列表。
所以你不能在模拟器中测试应用内购买,你需要一个 iOS 设备。
编辑:据我所知,当您尝试在模拟器上测试 IAP 时会发生这种情况,不会调用购买委托。
| 归档时间: |
|
| 查看次数: |
27614 次 |
| 最近记录: |