Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

tbayaa/flutter_zendesk_messaging

 
 

Repository files navigation

Zendesk Messaging

Pub

Messaging is a "user-based" chat

Live Chat is a "session-based" chat

  • Better UI (Native)
  • Chat history
  • Answer Bot

Setup

1. Enable agent work-space

2. Enable Messaging

3. Add channel and get key

How to use?

Initialize

 final String androidChannelKey = '';
 final String iosChannelKey = '';

  @override
  void initState() {
    super.initState();
    ZendeskMessaging.initialize(
      androidChannelKey: androidChannelKey,
      iosChannelKey: iosChannelKey,
    );
  }

just use initialize() one time

Show

ZendeskMessaging.show();

You can use in onTap()

Authenticate (optional)

The SDK needs to be initialized before using authentication methods !

// Method 1
final ZendeskLoginResponse result = await ZendeskMessaging.loginUser(jwt: "YOUR_JWT");
await ZendeskMessaging.logoutUser();

// Method 2 if you need callbacks
await ZendeskMessaging.loginUserCallbacks(jwt: "YOUR_JWT", onSuccess: (id, externalId) => ..., onFailure: () => ...;
await ZendeskMessaging.logoutUserCallbacks(onSuccess: () => ..., onFailure: () => ...);

Retrieve the unread message count (optional)

There's must be a logged user to allow the recovery of the unread message count!

// Retrieve the unread message count
final int count = await ZendeskMessaging.getUnreadMessageCount()();

// if there's no user logged in, the message count will always be zero.

Global observer (optional)

If you need to catch all events you can attach a global observer to the ZendeskMessaging.

ZendeskMessaging.setMessageHandler((type, args){
    print("$type => $args");
});

Weak

  • TagCurrently does not support. There is no way to help users with additional information like Chat.
  • Attachment fileCurrently does not support. The official said it will be launched in the future.
  • Chat room closed:An agent can not reply to a customer at any time. if the customer is not active in the foreground, the room will be closed automatically. It is inconvenient to track chat history.

Future Function

  • Push Notifications

Link

Contribute

  • You can star and share with other developers if you feel good and learn something from this repository.
  • If you have some ideas, please discuss them with us or commit PR.

About

Zendesk-Messaging for Flutter developer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 38.9%
  • Kotlin 26.9%
  • Swift 23.4%
  • Ruby 8.2%
  • Objective-C 2.6%