salesiq_mobilisten 2.1.2 copy "salesiq_mobilisten: ^2.1.2" to clipboard
salesiq_mobilisten: ^2.1.2 copied to clipboard

Mobilisten enables you to give your users the best in-app live chat experience. Mobilisten provides drop-in in-app chat and knowledge base.

example/lib/main.dart

import 'dart:io' as io;
import 'package:flutter/material.dart';
import 'dart:async';

import 'package:salesiq_mobilisten/salesiq_mobilisten.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    initPlatformState();
    initMobilisten();
  }

  Future<void> initMobilisten() async {
    if (io.Platform.isIOS || io.Platform.isAndroid) {
      String appKey;
      String accessKey;
      if (io.Platform.isIOS) {
        appKey = "INSERT_IOS_APP_KEY";
        accessKey = "INSERT_IOS_ACCESS_KEY";
      } else {
        appKey = "INSERT_ANDROID_APP_KEY";
        accessKey = "INSERT_ANDROID_ACCESS_KEY";
      }
      ZohoSalesIQ.init(appKey, accessKey).then((_) {
        // initialization successful
        ZohoSalesIQ.showLauncher(true);
      }).catchError((error) {
        // initialization failed
        print(error);
      });
      ZohoSalesIQ.setThemeColorForiOS("#6d85fc");
    }
  }

  Future<void> initPlatformState() async {
    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          appBar: AppBar(
            title: const Text('Example Application'),
          ),
          body: Center(child: Column(children: <Widget>[]))),
    );
  }
}
23
likes
0
pub points
91%
popularity

Publisher

verified publisherzoho.com

Mobilisten enables you to give your users the best in-app live chat experience. Mobilisten provides drop-in in-app chat and knowledge base.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on salesiq_mobilisten