SKProductsRequest app to launch on startup with iOS 7.0.3

The crash reports of our app started a flood last night. Many users who upgraded to 7.0.3 encountered a problem when the application started. An analysis of the itunes crash logs occurred because the application was killed for launching too long. Obviously, the call to check available purchases in the application is what led to the failure. We have removed all in-app purchases from the sale, and now users are reporting that the application is now working.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // earlier stuff... [self requestProductData]; // ask for in-app purchase localized prices/names [[SKPaymentQueue defaultQueue] addTransactionObserver:self]; // process any pending transactions // more stuff... } - (void) requestProductData { NSMutableSet * prodSet = [[[NSMutableSet alloc] initWithCapacity:10] autorelease]; StoreItem * curStoreItem; for(int j=0; j<[storeArr count]; j++) { curStoreItem = [storeArr objectAtIndex:j]; [prodSet addObject:curStoreItem.productID]; } SKProductsRequest *request= [[SKProductsRequest alloc] initWithProductIdentifiers:prodSet]; request.delegate = self; [request start]; } 

At didFinishLaunchingWithOptions, we make a request to request product data. Do I need to do this in another thread? Does anyone else have such a problem?

+5
source share
1 answer

We solved this in two ways, turning to immediately disabling the real application, and then actually turning to the encoding error that caused it.

The iOS 7.0.3 update has added latency to calls to apple servers that return product data in the application. Since we made a request for a product request from didFinishLaunching, our application was killed because it did not start fast enough.

To deal with a real-time crash, we temporarily removed all app purchases for the app from the sale. In the meantime, we rescheduled a product data request just before the storefront was presented in the application — the right software solution, as maddy suggested.

+1
source

Source: https://habr.com/ru/post/957520/


All Articles