• /
  • Log in


The iOS agent includes 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 to enhance your instrumentation.

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

crashNow (iOS SDK API)

Throws a demo run-time exception named NewRelicDemoException to test New Relic crash reporting.

currentSessionId (iOS SDK API)

Returns ID for current session.

incrementAttribute (iOS SDK API)

Increments the count of a session attribute. Overwrites previous value and type each time called.

recordBreadcrumb (iOS SDK API)

Records a MobileBreadcrumb event, useful for crash analysis.

recordCustomEvent (iOS SDK API)

Records a custom event from the iOS agent.

recordError (iOS SDK API)

Records Swift errors and NSErrors as MobileHandledException events. Optionally takes map with additional attributes showing context.

recordHandledException (iOS SDK API)

Records a handled exception. Optionally takes map with additional attributes showing context.

recordMetric (iOS SDK API)

Record custom metrics (arbitrary numerical data).

removeAllAttributes (iOS SDK API)

Removes all attributes from the session.

removeAttribute (iOS SDK API)

Removes the specified session attribute.

setAttribute (iOS SDK API)

Creates a session-level attribute shared by multiple mobile monitoring event types. Overwrites its previous value and type each time it is called.

setMaxEventBufferTime (iOS SDK API)

Sets the event harvest cycle length. Default is 600 seconds.

setMaxEventPoolSize (iOS SDK API)

Sets the maximum size of the event pool.

setUserId (iOS SDK API)

Set a custom user identifier value to associate user sessions with analytics events and attributes.

Create issueEdit page
Copyright © 2021 New Relic Inc.