Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat doesn't open on android #19

Open
faldunate opened this issue Apr 20, 2020 · 6 comments
Open

Chat doesn't open on android #19

faldunate opened this issue Apr 20, 2020 · 6 comments

Comments

@faldunate
Copy link

The plugin works correctly in IOS, but in android it does not open the chat

Does anyone know if there's a problem with the plug-in or am I doing something wrong?

  Future<void> initZendesk() async {
    zendesk.init(ZendeskAccountKey, department: 'Department Name', appName: 'App').then((r) async {
      print('init finished');
      UserData user = await fetchUser();
      zendesk.setVisitorInfo(
        name: user.nickname,
        email: user.email
      );
	  }).catchError((e) {
	    print('failed with error $e');
	  });

    if (!mounted) return;
  }
@override
void initState() {
    super.initState();
    initZendesk();
    if (!mounted) return;
}
FloatingActionButton(
  backgroundColor: Theme.of(context).primaryColor,
  child: Icon(Icons.headset_mic, color: Colors.white),
  onPressed: () async {
    zendesk.startChat().then((r) {
      print('startChat finished');
    }).catchError((e) {
      print('error $e');
    });
  },
) 
@ayaremin
Copy link

ayaremin commented May 30, 2020

Hello @faldunate

As a very temporary solution I just forked this repo and replaced the outdated zopim libraries with new zendesk messaging and support libraries.

You can use it in your app by adding this in your pubspec.yaml

zendesk:
    git:
      url: https://github.com/kngfrhzs/flutter-zendesk.git

And there is one more thing. You should also add your AndroidManifest.xml file to this activity

<activity android:name="zendesk.messaging.MessagingActivity" android:theme="@style/Base.Theme.AppCompat" />

Hope this solves your problems.

@abejr
Copy link

abejr commented Jun 18, 2020

Hello @kngfrhzs,
I tried your solution but I'm getting:
W/ActivityThread(24151): handleWindowVisibility: no activity for token android.os.BinderProxy@3b1fa69

Do you have any idea about what it is about?

@lkettwig
Copy link

I am also having an issue with this. If I include the plugin without forking, the chat opens on android. However, if I fork it into my own directory, the chat will not open on android. Is something different between master and the actual plugin 1.0.2?

@abejr
Copy link

abejr commented Aug 27, 2020

I couldn't make this plugin work so I end up using a plugin named https://github.com/ChangeFinance/zendesk-flutter-plugin

@ened
Copy link
Collaborator

ened commented Oct 31, 2020

@faldunate please retry using version 2.0.0.

@lkettwig
Copy link

lkettwig commented Nov 2, 2020

Version 2.0.0 didn't work for me either but I ended up making changes to my application AndroidManifest and MainActivity.java that worked. Follow the instructions here for testing a plugin with v2 embedding and also look at the AndroidManifest in the example given in the plugin: https://flutter.dev/docs/development/packages-and-plugins/plugin-api-migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants