Git Product home page Git Product logo

zendesk2's Introduction

An Android and iOS SDK port of Zendesk for Flutter

Android min SDK 16 and iOS min OS Version 10.0

Easy and fast to use

Setup for Native Chat

(Native chat is obsolete and is discouraged to be used)

Android Min SDK - 16

android/app/src/main/res/values/styles.xml

Add the following style

    <style name="ZendeskTheme" parent="ZendeskSdkTheme.Light">    
      <item name="colorPrimary">#FF5148</item>
      <item name="colorPrimaryDark">#FF5148</item>
      <item name="colorAccent">#FF5148</item>
    </style>

android/app/src/main/AndroidManifest.xml

Inside tag, insert the following Activity

    <activity android:name="zendesk.messaging.MessagingActivity"
        android:theme="@style/ZendeskTheme" />
iOS Min OS Version - 10.0

In AppDelegate.swift should look like this

override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
  GeneratedPluginRegistrant.register(with: self)

  //Snippet to make rootView as navigatable
  let flutterViewController = window?.rootViewController as! FlutterViewController
  let navigationController = UINavigationController.init(rootViewController: flutterViewController)
  navigationController.isNavigationBarHidden = true
  window.rootViewController = navigationController
  window.makeKeyAndVisible()

  return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}

You can have pre loaded localization with "Localizable.string"

See example/ios/Runnner/Localizable.string

See: https://developer.zendesk.com/embeddables/docs/ios_support_sdk/localize_text

Custom UI (Providers)

/// Zendesk Chat instance
Zendesk2Chat z = Zendesk2Chat.instance;

/// Initialize Zendesk SDK
await z.init(accountKey, appId);

/// Optional Visitor Info information
await z.setVisitorInfo(
    name: name,
    email: email,
    phoneNumber: phoneNumber,
  );

/// Very important, for custom UI, prepare Stream for ProviderModel
await z.startChatProviders();

/// Get the updated provider Model from SDK
z.providersStream.listen((providerModel) {
  /// this stream retrieve all Chat data and Logs from SDK
  _providerModel = providerModel;
});

/// It is also important to disconnect and reconnect and when the app enters  and exits background, to do this you can simply calll
z.disconnect() 
z.connect()  

Push Notifications

To configure chat notifications, you will need to do the following configuration per platform

iOS

Inside your AppDelegate.swift import the ChatSdk import ChatProvidersSDK

Add the following method

  override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
      //Messaging.messaging().apnsToken = deviceToken  /// You might already have this if you are using firebase messaging
      
      Chat.registerPushToken(deviceToken)
  }

Android

Using FCM messaging, get your FCM token and register it as follows:

Zendesk2Chat z = Zendesk2Chat.instance;
await z.registerFCMToken(fcmToken);

(calling this function has no effect on iOS)

To display the notifications, you will need to register your own FirebaseMessagingService as a service inside the application. You can follow the Firebase Android Docs for this. An example file that you can copy and customize can be found in the main github repo. Overally you will add the file to your application and register the service as follows:

<service
    android:name="{your package name}"
    android:stopWithTask="false">
    <intent-filter>
        <action android:name="com.google.firebase.MESSAGING_EVENT" />
    </intent-filter>
</service>

What you need

  • AccountKey

  • AppId

  • Update Cocoapods to latest version

STATUS

Chat SDK

Live Chat, Customization and Providers for custom UI

Live Chat - OK
Support SDK - OK
Customization - OK

Far development

Unified SDK

Answer BOT SDK

Talk SDK

zendesk2's People

Contributors

kiplelive-zariman avatar kohlsadrian avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.