Can I add logEvent when app is before/after crash? Idea is I want to add user account to "crash log" or something data and when app is crash I know in what account occurred crash.
Thx.
Yep, I think you can do it; looking at iOS SDK Documentation for Flurry, you should look at the method
(void) + logError:message:error:
This method captures an error for reporting to Flurry, so you can use it for add some extra info. See this example:
- (void) webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
[Flurry logError:#"WebView No Load" message:[error localizedDescription] error:error];
}
I searched something similar 'time ago for the same reason and I found it this method; I think you can use the parameter message for concatenate your info.
PS = I'm really interested in this topic so I continue looking for find some more info, If I'll have something more useful I'll update this answer.
Related
My errors are getting logged. I can see the errors in the log. I'm trying to figure out how to find the specific information that I'm logging, especially the message parameter. I've tried looking through the documentation and clicking endlessly around the website with no luck.
I'm logging errors to flurry like this.
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error{
[Flurry logError:#"Location Error" message:error.localizedDescription error:error];
}
The error shows up in the log like this.
How can I find the error message that I logged?
Just saw an answer in a similar post.
In Flurry, go to Technical > Errors. Then at the bottom of the page it shows each error and its message.
Not super intuitive.
so i have finished making my application and i am wondering is it mandatory to add code that checks if the user has a valid connection to the internet or not? one of the reasons I'm asking this is because in my previous app i used this piece of code below.
- (void) webView:(UIWebView*) webview didFailLoadWithError:(NSError *)error {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#"Important" message:#"Sorry,
it seems you are not currently connected to a network, please try again later." delegate:self
cancelButtonTitle:#"I understand" otherButtonTitles: nil];
[alert show];
}
I used this i believe with Xcode 4 and iOS 6 i believe has something changed in the Xcode 5.1.1 and iOS 7, or am i doing something wrong. Sorry to sound stupid but its really bugging me.
Thank you
It is not needed, and is not specified anywhere in Apple's terms and conditions. However, it is kind of a standard procedure to warn your user if he encounters some kind of problem. I would strongly suggest that you implement these delegate methods.
Is there a callback for failed media playbacks in the Google Cast iOS Framework? I wasn't able to find anything useful in the documentation or the sample apps on github.
Specifically, I'm looking for load errors of HLS streams... So in case CORS isn't properly configured, the parsing of *.m3u8 files fails, I want the sender iOS app to know about.
This is the closest I have found:
- (void)deviceManager:(GCKDeviceManager *)deviceManager didFailToConnectToApplicationWithError:(NSError *)error
- (void)deviceManager:(GCKDeviceManager *)deviceManager didFailToConnectWithError:(NSError *)error
However, if connecting to the device, and launching the receiver application succeed, these callbacks will never fire.
Thanks for your help!
Found it!
- (void)mediaControlChannel:(GCKMediaControlChannel *)mediaControlChannel didFailToLoadMediaWithError:(NSError *)error
Is it possible to handle a request timeout with a UIAlert? I would like to inform the user that there has been a time out. I set 0.0 just for testing to see if it would occur. The log does not print out so i do not believe i am handling correcting
request.timeoutInterval=0.0;
and to handle it:
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
if(error.code == NSURLErrorTimedOut){
NSLog(#"Time out");
}
}
I am using NSURLConnectionDelegate and NSURLConnectionDownloadDelegate
Thanks.
You can find a list of all the relevant error codes here. Note that -1009 is kCFURLErrorNotConnectedToInternet. To force a timeout, you need to have the ability to suppress the actual sending of the URL, or find one that just goes into a black hole.
Apple bundles Network Link Conditioner with Xcode (its in the networking tools I believe). There is a great article on this tool on NSHipster.
Another way (I believe) to get a timeout is to immediately after sending a request is to switch to another app, putting yours in the background. Wait 5 minutes, switch back, and look at the log. What you can do is in a demo app continually send out NSURLConnections - that is, once the first returns, send another. so there is always one outstanding. Now switch your app out - switch to another app in the simulator - wait, then return. You should be able to catch the condition this way, you can see the affect of changing the timeoutinterval value.
There was a long thread about timeouts in the private Apple forums for iOS networking - you may be able to find it. In the end, the system enforces a reasonably long minimum (as I recall), and you may be able to make it longer but not shorter. This hidden behavior has for sure baffled many people. The responder to the question was Quinn "The Eskimo", one of Apple's most experienced networking engineers.
Cheers,
It appears to me like SKProductsRequest does not handle timeouts or connection errors in any way. It either calls -(void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response on its delegate in case of success, or it doesn't.
I'd like to present my users with some kind of activity indicator while the products are being retrieved, or maybe pop up an alert if the appstore can't be reached. Since (in case of failure) there's no feedback from the SKProductsRequest however, I wonder to which event I should tie the presentation of that feedback - other then waiting for an arbitrary amount of time.
So, the question is: Is there a known amount of time after which it is safe to assume the request has failed? Or is there any way to check upon the status of a pending request that I just failed to see?
I run this in my project for whenever an SKRequest fails (which includes SKProductRequest):
- (void)request:(SKRequest *)request didFailWithError:(NSError *)error
{
alert = [[UIAlertView alloc] initWithTitle:#"In-App Store unavailable" message:#"The In-App Store is currently unavailable, please try again later." delegate:nil cancelButtonTitle:#"OK" otherButtonTitles:nil, nil];
[alert show];
}
Works a treat. Of course you can place anything inside the brackets to replace my alert, but this works well for the user.
Hope this is of use to you.
Note: This is in SKRequestDelegate not in SKProductsRequestDelegate, which is slightly confusing. The SKRequestDelegate is used for purchasing and for product requests. The delegate set using request.delegate can implement methods for both.
I don't believe you can do anything other than wait an arbitrary amount of time. In some of my apps I wait 30 seconds (while showing a modal activity view) and then bail out with a generic error alert. The problem is, in reality 30 seconds is beyond most users' attention span for such issues, but if you make it short enough to be useful (say 15 seconds), you might actually bail too early.
I don't think there is a better option ... but I'm willing to learn otherwise!