Access The Session URL

Retrieve the LogRocket session URL for use in integrations

Integration with third party services can be accomplished by retrieving the Session URL and adding it as context to the third party library. In the iOS SDK, the session URL can be accessed with the SDK.getSessionURL method. Session URLs are only made available when our backend has accepted the session, which can take 1-5 seconds from when the SDK is initialized.

As of SDK version 1.32.0, once a getSessionURL handler is registered, it will be called each time a new session is started. A hardShutdown clears all registered handlers.

SDK.getSessionURL { sessionURL in
  // Use the accepted Session URL
}
void (^completion)(NSString*) = ^(NSString* sessionURL) {
  // Use the accepted Session URL
}

[LROSDK getSessionURL:completion]

🚧

Main UI Thread Considerations

The session URL handler may be run on a background thread. To prevent errors, avoid modifying UI elements within getSessionURL , or wrap any UI modifications with if Thread.isMainThread.