Getting session URL

Sometimes you may need to get URL pointing to current session from code. Say you want link crash in your crash reporter with it, write it to logs or display in your debug UI. To get this URL you have to add a session start callback:

config.startCallback = { sessionURL in
	  // Save url for future use...
}
[config setStartCallback:^(NSURL *sessionURL) {
    // Save url for future use...
}];

Some hints:

  • Callback get called on a non-main thread and not guaranteed to be called on a caller thread so be carefull with not thread-safe APIs inside it
  • Callback will be called again upon restart, either when you call stop/start methods or when session was dropped due to networking issues