Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 971 Bytes

crossplatform-flutter-en.md

File metadata and controls

39 lines (29 loc) · 971 Bytes
  1. To download the iOS dependency, it is necessary to have cocoapods installed. To install it, follow this guide

  2. Añade la librería al proyecto con el siguiente comando

flutter pub add emma_flutter_sdk
  1. 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);
    }
}