iOS SDK API

New Relic Mobile has an SDK API to customize how New Relic monitors your app. For example, use methods in the NewRelic object to send custom attributes and events for your iOS app to New Relic Insights.

Here are all the methods in this API. For more information, see the New Relic iOS SDK API guide.

crashNow
Throws a demo run-time exception named NewRelicDemoException to test New Relic crash reporting.
currentSessionId
Returns ID for current session.
incrementAttribute
Increments the count of a session attribute. Overwrites previous value and type each time called.
recordBreadcrumb
Records a MobileBreadcrumb event, useful for crash analysis.
recordCustomEvent
Records a custom New Relic Mobile event.
recordError
Records Swift errors and NSErrors as MobileHandledException events. Optionally takes map with additional attributes showing context.
recordHandledException
Records a handled exception. Optionally takes map with additional attributes showing context.
recordMetric
Record custom metrics (arbitrary numerical data).
removeAllAttributes
Removes all attributes from the session.
removeAttribute
Removes the specified session attribute.
setAttribute
Creates a session attribute. Overwrites its previous value and type each time it is called.
setMaxEventBufferTime
Sets the event harvest cycle length. Default is 600 seconds.
setMaxEventPoolSize
Sets the maximum size of the event pool.
setUserId
Set a custom user identifier value to associate user sessions with analytics events and attributes.