JivoChat / JivoSDK-FlutterDemo

0 stars 0 forks source link

The operator does not see info in chat from setContactInfo method #8

Open yauheniprakapenka opened 6 months ago

yauheniprakapenka commented 6 months ago

jivosdk_plugin: 0.9.2, Android and iOS

The operator does not see info in chat from setContactInfo method

import 'package:flutter/material.dart';
import 'package:jivosdk_plugin/bridge.dart';

Future<void> main() async {
  runApp(const App());
}

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  const HomePage();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: const Center(
        child: Text(
          'JivoSDK Flutter Demo',
          textAlign: TextAlign.center,
        ),
      ),
      floatingActionButton: TextButton(
        onPressed: () async {
          await _setupJivo();
        },
        child: const Text('Chat'),
      ),
    );
  }

  Future<void> _setupJivo() async {
   await Jivo.session.setContactInfo(
      name: 'Homer',
      email: 'h.simpson@springfield.com',
      phone: 'Simpson',
      brief: 'Family guy',
    );
    await Jivo.session.setup(channelId: 'zzzzzzzz', userToken: '12345');
    await Jivo.display.present();
  }
}