我試圖將應用程序購買添加到我的應用程序中,所以想了解周圍的interwebs後,我決定去MKStoreKit,現在設置了一切,項目看起來沒問題,應該在服務器上的文件實際上在服務器上以及所有這些東西。MKStoreKit非易耗品在連接和NSUbiquitousKeyValueStore中都失敗
當我在設備上運行應用程序時,混亂髮生,我推測試按鈕「購買」。 首先這是結果我得到了。
2012-02-09 17:45:28.324 MyApp[7147:707] checking if com.my.company.testinapp.pack001 pack is purchased
2012-02-09 17:45:30.814 MyApp[7147:707] Review request cannot be checked now: (null)
2012-02-09 17:45:33.335 MyApp[7147:707] NSUbiquitousKeyValueStore error: com.my.company.inapp has no valid com.apple.developer.ubiquity-kvstore-identifier entitlement
2012-02-09 17:45:33.370 MyApp[7147:707] Problem in iTunes connect configuration for product: com.my.company.testinapp.pack001
2012-02-09 17:45:34.063 MyApp[7147:707] User cancelled transaction: <SKPaymentTransaction: 0x8c0fde0>
2012-02-09 17:45:34.064 MyApp[7147:707] error: Error Domain=SKErrorDomain Code=3 "Cannot connect to iTunes Store" UserInfo=0x8c1f210 {NSLocalizedDescription=Cannot connect to iTunes Store}
2012-02-09 17:45:34.065 MyApp[7147:707] User Cancelled Transaction
2012-02-09 17:45:58:174 MyApp[7147:20747] finished networking setup
讓我們退一步來給看看到sceanrio:
這是我的調用代碼
- (IBAction)iap:(id)sender {
NSLog(@"checking if %@ pack is purchased", kFeatureAId);
if([MKStoreManager isFeaturePurchased:kFeatureAId]) { //unlock it
NSLog(@"horray, you already purchased this item!");
} else {
[[MKStoreManager sharedManager] buyFeature:kFeatureAId
onComplete:^(NSString* purchasedFeature) {
NSLog(@"Purchased: %@", purchasedFeature);
} onCancelled:^ {
NSLog(@"User Cancelled Transaction");
}];
}
}
所以基本上我做什麼不是調用購買一個測試項目。
這是MKStoreConfig.h
#define kConsumableBaseFeatureId @"com.my.company.inapp" /* this is the bundle id */
#define kFeatureAId @"com.my.company.testinapp.pack001" /* this is the product id */
#define kConsumableFeatureBId @"com.my.company.testinapp.pack001.582046155" /* this is the product id + product number */
#define FishBasket @"FishBasket"
#define SERVER_PRODUCT_MODEL 4
#define OWN_SERVER @"http://testings.company.my.com/inappscripts"
#define REVIEW_ALLOWED 1
#warning Shared Secret Missing Ignore this warning if you don't use auto-renewable subscriptions
#define kSharedSecret @"d43ecfa9d8b94facfbcfed1eca509dbe"
這些相關信息應足以使我的情況的分析,如果你需要更多的細節,只是問,我會很高興回答。
希望有人可以幫助我這個。 :) 在此先感謝!
-K-
THX,這個問題是關係到 「通訊錄,稅務和銀行」 詳細信息的不完備。現在它就像一個魅力。 Thx爲了拯救我,形成了這個,這讓我瘋狂^^ – holographix 2012-02-10 15:13:54