This is watchtower client implementation. The client provides the main functionality:
- to collect basic application data
- send events
- record user sessions
Required application data:
- Application id: Unique application id receives from the product manager.
- Application bundle: Unique application bundle receives from the product manager.
- Application key: Unique application bundle receives from the product manager.
- Aplication version: Current application version. Generates by the developer.
Uses to send an application start event. Sends automatically by SDK.
Future<void> sendAppStartEvent() async
Uses to send a log event.
Future<void> sendLogEvent({Level? level, String? message, String? moduleName}) async
level: [Level?] Dart logging level. message: [String?] Log message. moduleName: [String?] Module name or class name caused a log message.
Uses to send opening web URL information.
Future<void> sendOpenLinkEvent({required String uri, int? responseCode, String? responseText}) async
- uri: [String] Opening URL. (Required)
- responseCode: [Int?] Response code, received from a server.
- responseText: [String?] Response text, received from a server.
Uses to send a custom event with random data.
Future<void> sendCustomEvent({required String data}) async
data: [String] event data. (Required argument)
Init and configure Watchtower SDK. Should be requested before any other actions.
Future<void> init({required String appId, required String appKey, String host = 'watchtower.cyou', int port = 8008}) async
- appId: [String] application id (Required)
- appKey: [String] application key (Required)
- host: [String] watchdog server host. (Default value: watchtower.cyou)
- port: [int] watchdog server port. (Default value: 8008)
Update user data stored on device. Currently receives gaid only
Future<void> updateUserAppData({String? gaid}) async
gaid: [String?] User GAID value
Clear all user and application data
Future<void> clearData() async
class AppData {
final String appId;
final String appBundle;
final String appVersion;
final String appKey;
}
- appId: [String] Unique application id receives from the product manager. (Required)
- appBundle: [String] Unique application bundle receives from the product manager. (Required)
- appVersion: [String] Current application version. Generates by the developer. (Required)
- appKey: [String] Unique application bundle receives from the product manager. (Required)