getUserAgent

The getUserAgent() method returns the default user agent string used by the SDK. Use this method when your app uses a WebView and you want to recognize the same visitor across native and web content. Set the WebView to use the same user agent string.

Syntax

await FlutterPiwikPro.sharedInstance.getUserAgent();

Returns

The default user agent string used by the SDK, not a string that describes the method and its parameters.

Type: string

Examples

To get the user agent string:

final String userAgent = await FlutterPiwikPro.sharedInstance.getUserAgent();