-
To download the iOS dependency, it is necessary to have cocoapods installed. To install it, follow this guide
-
Añade la librería al proyecto con el siguiente comando
flutter pub add emma_flutter_sdk
- In lib/main.dart add the following code
import 'dart:async';
import 'dart:io' show Platform;
import 'package:emma_flutter_sdk/emma_flutter_sdk.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
initPlatformState();
await EmmaFlutterSdk.shared
.startSession("%%%SESSION_KEY%%%", debugEnabled: true);
}
}