By default, each user will be identified with a unique guid and marked as anonymous. The identifier property on the RaygunUserInformation class is what separates one user from another. Be sure to set it with something unique, for example a database id, username or email address. If the user changes, for instance when logging in or out, be sure to update the user information on the shared Raygun client each time. You can assign user information as described below.
**Objective-C:** RaygunUserInformation *userInfo = [[RaygunUserInformation alloc] initWithIdentifier:@"firstname.lastname@example.org" withEmail:@"email@example.com" withFullName:@"Test User" withFirstName:@"Test"]; RaygunClient.sharedInstance.userInformation = userInfo;
let userInformation = RaygunUserInformation(identifier: "firstname.lastname@example.org", email: "email@example.com", fullName: "Test User", firstName: "Test") RaygunClient.sharedInstance().userInformation = userInformation
Automatic network performance monitoring
The provider has the ability to automatically record the time it took to complete network requests. Use the following snippet to enable this feature. Network performance monitoring can only be enabled after enabling Real User Monitoring on the client.
Details about all automatically and manually logged network calls can be found on the Performance tab of your Real User Monitoring for mobile dashboard.
The provider will track the performance of network calls made with the following methods:
// NSURLSession methods dataTaskWithURL: dataTaskWithURL:completionHandler: dataTaskWithRequest: dataTaskWithRequest:completionHandler: downloadTaskWithURL: downloadTaskWithURL:completionHandler: downloadTaskWithRequest: downloadTaskWithRequest:completionHandler: uploadTaskWithRequest:fromData: uploadTaskWithRequest:fromData:completionHandler: uploadTaskWithRequest:fromFile: uploadTaskWithRequest:fromFile:completionHandler: // NSURLConnection methods sendAsynchronousRequest:queue:completionHandler sendSynchronousRequest:returningResponse:error:
Manually report timings
You are able to manually report network timings to Raygun using the following snippet with duration being measured in milliseconds.
[RaygunClient.sharedInstance sendTimingEvent:RaygunEventTimingTypeNetworkCall withName:@"www.raygun.com/rum" withDuration:120];
RaygunClient.sharedInstance().sendTimingEvent(type: RaygunEventTimingType.networkCall, name:"www.raygun.com/rum", duration:120)
Since network requests are automatically detected, there may be network request that are not helpful to record and should be ignored. The following snippet can be used to stop the provider from sending timing events for those requests whose URLs contain specific text.