App crash in offline mode
Hi, I'm testing Baker with latest version (download on 13 feb 2013 ). And I found problem on my iPad.
- I running the app it work fine. And Did not do anything. ( I have already .json file on sever)
- Tap home button to home screen.
- Turn off the wifi.
- Kill app in background.
- Open it again. App would crash.
- Try to do point 5 again. App still crash
- But if I turn on wifi. Try to do point 5 again. App can run smooth again.
We have to check that, thanks for the feedback.
- Does the issue appear also on version 4.0?
- Could you please past the debug log?
Ops, I miss something. Edit comment 1 change point 6-7.
Answer. 1.YES 2.Wait a moment please.
Here is my debug log...
Feb 26 19:50:33 2fellows-IPAD4 Baker[5757]
I sensors my json path it is private
I focus the point of problem.
This error ONLY occur after the program downloaded an issue. sorry in comment 1 is not clear
And do this loop. -Tap home button to home screen. -Turn off the wifi. -Kill app in background. -Open it again. App would crash. -Try to do point 5 again. App still crash -But if I turn on wifi. Try to do point 5 again. App can run smooth again.
Thanks! :)
OK. I found the true problem. I would like to forget in a top comment.
If you fix the subscription such as "com.companyname.baker.Free" and turn off wifi. And running App on iPad. Then the app will crash. But in simulator work fine.
Alert call this line. in PurchasesManager.m
-
(void)request:(SKRequest *)request didFailWithError:(NSError *)error { NSLog(@"App Store request failure: %@", error); NSDictionary *userInfo = [NSDictionary dictionaryWithObject:error forKey:@"error"]; [[NSNotificationCenter defaultCenter] postNotificationName:@"notification_products_request_failed" object:self userInfo:userInfo];
[request release];
}
I added conditions.
-
(void)request:(SKRequest *)request didFailWithError:(NSError *)error { NSLog(@"App Store request failure: %@", error);
if(error) { NSDictionary *userInfo = [NSDictionary dictionaryWithObject:error forKey:@"error"]; [[NSNotificationCenter defaultCenter] postNotificationName:@"notification_products_request_failed" object:self userInfo:userInfo]; }
[request release];
}
I do not know what is the best way? But the problem has been solved.
I did a bit of testing. If you have configured In-App Purchases and there's no connection, you will get a couple of alerts saying "Failure connecting to the App Store". This is annoying and so I've fixed it in e913b8cbcd9944ebf906dca93c32ef86d6208f6d, but in all my tests I could not get the app to crash.
Can you test again with the latest master?
OK, It works perfectly. Thank!!
But I think about alerts internet problem.It call specifically when run App on simulator. If run app to iPad. The first thing to do get ".json" for show on shelf(It have caches now). And turn off wifi , Kill App in background, Open it again , And no any further notification. The truth to be notified every time or not? When open the app ( without an app running in background ). Or alerts after being active some button when no internet connection. This is just my opinion. And very sorry in my english.
I'm sorry, I can't quite understand. I'll try to rephrase.
If you open the app for the first time and there's no internet connection, you will get an alert. If you open the app after having cached the shelf JSON and there's no internet connection, the cache will be used and you will not get an alert.
The cached shelf JSON should persist even if you kill the app.
Is that the behaviour you're experiencing? What exactly is your issue with alerts?
You understand it correctly. I think the "App" must be notified if User tap down on download button. Because,In offline mode the latest version of "baker" not show alert when user active the button it get stuck to waiting for progress . But I configure this at #714.
Closing as the issue is now fixed. Will track your suggestion in the issue you opened.