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.
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.
Raygun4Apple supports tracking the version of your application by setting the
applicationVersion property of the Raygun client.
// Instantiate a new Raygun client RaygunClient *raygunClient = [RaygunClient sharedInstanceWithApiKey:@"_INSERT_API_KEY_"]; // Set the application version raygunClient.applicationVersion = @"1.0.0";
The applications version will then be tracked in Real User Monitoring allowing you to see how many users are using each version of your application.