Reputation: 6462
I have an iPhone app which is using parse as backend. I have successfully integrated everything.I've test it and it's running perfectly on my devices ( simulator and physical devices ). The problem is that my clients are complaining that the app is crashing on their devices when trying to fetch data from Parse.
What can be the problem?
Upvotes: 0
Views: 205
Reputation: 6462
I've fixed this with the following.
And now both the apps are working fine on my clients phones.
Upvotes: 0
Reputation: 982
I would suggest definitely adding an analytic api to monitor crashes etc...
try this: http://try.crashlytics.com/sdk/
Also you should implement a network check when deploying apps that communicate with a backend so you are in control of whatever network scenario arrises.
try this: https://developer.apple.com/library/ios/samplecode/Reachability/Introduction/Intro.html
Also did you try deleting the app off of your device and downloading the way your clients are?
Also a crash isnt specific. Is it just hanging, does it kill the app etc...? If you know a client have them check the device logs and send you over a copy.
Upvotes: 1
Reputation: 21520
Parse may not be the problem.
Have you try to "Reset content and settings" on simulator and launch again app? Does still it work?
Another possibility is that you manage in a wrong way errors from parse request.
Example:
func postNewPerson(person: Person?, completion: (success: Bool, result: Person?, error: NSError?) -> Void) {
var p = PFObject(className: "Person")
p["name"] = person.name
p["lastName"] = person.lastName
p.saveInBackgroundWithBlock {
(success: Bool, error: NSError?) -> Void in
if (success) {
completion(success: true, result: person, error: nil)
} else {
completion(success: nil, result: nil, error: error)
}
}
}
when you call this function you have to test for success/error:
service.postNewPerson(person: person) { (success, result, error) -> Void in
if error != nil && success == true {
/* Your request is ok */
} else {
/* Something wrong */
}
}
Upvotes: 0
Reputation: 632
There is high chance that this happen due to network issues, for example if the device is on airplane mode. When device is in offline mode it will try couple of time and throws;
0xa3884: b 0xa3860; _40-[PFTask thenCallBackOnMainThreadAsync:]block_invoke_2 + 340 at PFTask.m:329
And console will state;
Terminating app due to uncaught exception 'NSInternalInconsistencyException'....
This may or may not be the reason in your case, but there's a possibility.
Also, may I suggest the user of Fabric.io for your app release to your clients. So you can get a clear understating about when, how and why the app crashes. Hope this helps.
Upvotes: 1