Session Replay for Mobile RUM

Session Replay allows you to monitor user activity within mobile applications by recording interactions such as clicks, scrolls, and navigation. It captures these interactions as dynamic, video-like journeys, along with detailed session metadata. This provides teams with clear insight into the user experience, especially when issues arise. You can watch the session replay to:
  • Optimize the user experience.

  • Debug the errors for application crashes.

  • Diagnose the reasons for application slowness.

Session Replay Licenses

Session Replay is an add-on license available for the packages: RUM Peak, Browser RUM-Pro, Browser RUM-Peak, Mobile RUM-Pro, and Mobile RUM-Peak. For more information, see Session Replay.

Prerequisites

Ensure that the following conditions are met to use Session Replay:
  • Controller >= 25.10

  • EUM Server >= 25.10

  • iOS Agent >= 25.9

  • Android Agent >= 25.9

Log in to the administration console and add the following property to use Session Replay:
  1. Go to Account Settings.

  2. Click Add Property and add session.replay.enabled. Set the value of this property to true.

Prerequisites

Ensure that the following conditions are met to use Session Replay:
  • Controller >= 25.10

  • EUM Server >= 25.10

  • iOS Agent >= 25.9

  • Android Agent >= 25.9

Log in to the administration console and add the following property to use Session Replay:
  1. Go to Account Settings.

  2. Click Add Property and add session.replay.enabled. Set the value of this property to true.

Configure the iOS Agent to Report Session Replay

To report Session Replay for your mobile application, you must configure the iOS Agent as follows:
Note: The iOS Agent knows which path to use to make calls to different services (Collector/Screenshot Service). For example, if the EUM Server URL is https://myEUMServerURL.com:7001, the iOS Agent will know to use https://myEUMServerURL.com:7001/eumcollector to make requests to the EUM Collector. By specifying the Collector URL, you will not be able to use the SaaS deployment of the EUM Cloud for the Screenshot Service.
Objective C
#import <ADEumInstrumentation/ADEumInstrumentation.h>
#import "AppDelegate.h"
  
    // ...
    -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        ADEumAgentConfiguration *config = [[ADEumAgentConfiguration alloc] initWithAppKey:<#EUM_APP_KEY#>];
		// Set the Collector URL, Screenshot Service URL, and Session Replay URL to the EUM Server URL.
	    config.collectorURL = <#COLLECTOR_URL:PORT#>;
	    config.screenshotURL = adeumAgentConfig.collectorURL;
        config.sessionReplayURL = <#SESSIONREPLAY_URL:PORT#>;
        [ADEumInstrumentation initWithConfiguration: config];
        // other tasks
        return YES;
     }
Swift
#import <ADEumInstrumentation/ADEumInstrumentation.h>
#import "AppDelegate.h"
  
    // ...
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        let config = ADEumAgentConfiguration(appKey: <#EUM_APP_KEY#>)
        // Set the Collector URL, Screenshot Service URL, and Session Replay URL to the EUM Server URL.
	    config.collectorURL = <#COLLECTOR_URL:PORT#>
	    config.screenshotURL = config.collectorURL
        config.sessionReplayURL = <#SESSIONREPLAY_URL:PORT#>
        ADEumInstrumentation.initWith(config)
        // other tasks
        return true
    }
// ...
To protect user privacy during session recordings, configure Session Replay to mask sensitive data by enabling options that obscure all text and input fields by default. For more information, see Handle Sensitive Data.

Configure the Android Agent to Report Session Replay

To report Session Replay for your mobile application, you must configure the Android Agent as follows:
  1. Initialise the agent by the following methods:
    • .withSessionReplayEnabled(true)

    • .withBlobServiceURL(configHelper.getSessionReplayUrl())

    • (Optional) Default configuration: RenderingMode.NATIVE_MODE.withSessionReplayRenderingMode(RenderingMode.WIREFRAME_MODE)

    import com.appdynamics.eumagent.runtime.Instrumentation;
    ...
    @Override public void onCreate(Bundle savedInstanceState) {
      Instrumentation.start(AgentConfiguration.builder()
        .withAppKey("<EUM_APP_KEY>")
        .withContext(getApplicationContext())
        // The default SaaS EUM Server and Screenshot Service are in the Americas,
        // so you can omit the following settings if you are in the Americas.
        .withSessionReplayEnabled(true)
        .withBlobServiceURL(configHelper.getSessionReplayUrl()) 
        .build());
      ...
    }
  2. In your app module-level build.gradle file, add session replay SDK.
    
    ...
    ...
    repositories {
            maven {
                url = "https://sdk.smartlook.com/android/release"
            }
        }
    ...
    ...
    dependencies {
            implementation 'com.cisco.android:sr-instrumentation-session-recording-core:1.0.12' 
    }
To protect user privacy during session recordings, configure Session Replay to mask sensitive data by enabling options that obscure all text and input fields by default. For more information, see Handle Sensitive DataHandle Sensitive Data.

セッションリプレイの有効化

管理者はセッションリプレイのみを有効にできます。選択したモバイルアプリケーションのセッションリプレイを有効にするには、以下のオプションを実行します。
  1. コントローラ UI にログインします。
  2. 対象のモバイルアプリケーションを開きます。
  3. 左のナビゲーションメニューで、[Configuration] を選択します。
  4. [Mobile App Group Configuration.] をクリックします。
  5. [Session Replay] タブで、[Enable Session Replay] を選択します。
    注: Xcode's Main Thread Checker

    デバッグモードで iOS アプリを起動すると、数秒間停止することがあります。セッションリプレイを有効にすると、セッションリプレイが開始し警告が表示されます。この問題は、Xcode のメインスレッドチェッカーの診断によって引き起こされます。

    Main Thread Checker: UI API called on a background thread: -[UIView drawViewHierarchyInRect:afterScreenUpdates:]
    

    この警告は無害であり、iOS エージェントがバックグラウンドで画面をキャプチャしていることが原因で発生します。別の方法(メインスレッドでスクリーンショットをキャプチャする)は、アプリケーション UI の不具合を引き起こす可能性があります。そのため、この方法で実装し、この警告を表示することは、シームレスな記録機能を有効にするために必要なトレードオフです。

    この警告は、デバッグ中にアプリケーションが短時間フリーズする場合にも表示されます。このフリーズは実稼働環境ビルドでは発生せず、メインスレッドチェッカーの Xcode 診断オプションが原因で発生します。

    このオプションは、それぞれの実行スキームの診断オプションでオフにすることができます。詳細については、「メモリ、スレッド、クラッシュの問題の早期診断」の「バックグラウンドセクションの不適切な UI 更新の検出」セクションを参照してください。

セッションリプレイの表示

セッションリプレイでは、複数の録音とユーザーインタラクションが組み合わされています。セッションリプレイを表示するには、以下の手順を実行します。
  1. ユーザー Experience > Mobile Apps に移動します。記録が可能な場合、[セッションリプレイ(Session Replay)] に再生アイコンが表示されます。[セッションリプレイ(Session Replay)] タブを展開します。
  2. セッションリプレイを有効にしたアプリケーションを選択します。
  3. Sessions を選択します。
    記録が可能な場合、Session Replay に再生アイコンが表示されます。
  4. [Session Replay] タブを展開します。
Session Replay は、セッションのアクティブなセグメントを強調表示します。録画またはユーザー アクティビティがない場合は、空白の画面が表示されます。
セッションリプレイの表示中に、以下のアクションを実行できます。
  • 再生速度を調整する。

  • Video モードと Wireframe モードを切り替える。Wireframe モードでは、セッションリプレイは UI レイアウトだけを表示し、テキストはマスクされます。