0
我在iOS遊戲中實施了應用程序內置功能。應用程序中的作品,但每次我測試它時(使用測試帳戶),下一次運行我的應用程序時,只要我加載應用程序商店產品就會詢問我的登錄名/密碼(應用程序儘快發佈發射)。如果我取消了,它會在下次應用程序運行時再次詢問用戶憑據,等等,直到用戶輸入登錄名/密碼。iOS應用程序在下次運行應用程序時詢問密碼
這是沙箱問題還是我的實施問題?我該如何解決這個問題?
這裏使用我的代碼的相關部分加載產品/採購:
class InAppIos::Private {
public:
// ...
void loadProducts(const std::vector<std::string> & identifiers) {
NSMutableSet *nsids = [NSMutableSet setWithCapacity:identifiers.size()];
for (unsigned int i = 0; i < identifiers.size(); ++i) {
[nsids addObject:[NSString stringWithUTF8String:identifiers[i].c_str()]];
}
SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers:nsids];
request.delegate = productRequestDelegate;
[request start];
}
void onProductsResponse(SKProductsResponse *response) {
unsigned int count = response.products.count;
InAppProductList products;
for (unsigned int i = 0; i < count; ++i) {
Pointer<InAppProduct> product(new InAppProductIos((SKProduct *)[response.products objectAtIndex:i]));
products.push_back(product);
productMap[product->getIdentifier()] = product;
}
listener->onProductsResponse(products);
}
// ...
};
void InAppProductIos::buy(unsigned int quantity) {
if (!InApp::get()->isInAppEnabled()) {
MessageBox::showMessageBox("Error", "Cannot process payment.", "OK");
return;
}
SKMutablePayment *payment = [SKMutablePayment paymentWithProduct: product];
payment.quantity = quantity;
[[SKPaymentQueue defaultQueue] addPayment:payment];
}