vlogs_sdk_dart/example/vlogs_example.dart

26 lines
662 B
Dart
Raw Normal View History

2023-05-27 01:06:18 +07:00
// ignore_for_file: non_constant_identifier_names
import 'package:vlogs/vlogs.dart';
void main() async {
final APP_ID = "72bd14c306a91fa8a590330e3898ddcc";
final API_KEY = "vlogs_gX9WwSdKatMNdpUClLU0IfCx575tvdoeQ";
2023-05-27 09:47:24 +07:00
final sdk = VLogs.createWith(APP_ID, API_KEY);
2023-05-27 01:06:18 +07:00
var request = Collector.builder()
2023-05-27 01:06:18 +07:00
.message("Hello World")
.source(CollectorSource.mobile.name)
.type(CollectorType.log.name)
.build();
// Run this to test non-blocking collect
sdk.collectAsync(request);
// Run this to test blocking collect
2023-05-27 01:06:18 +07:00
var response = await sdk.collect(request);
// Output the response
2023-05-27 01:06:18 +07:00
print("Response: ${response.toJson()}");
}