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

PlatformException(channel-error, Unable to establish connection on channel., null, null) #34

Open
emren opened this issue Apr 14, 2021 · 9 comments

Comments

@emren
Copy link

emren commented Apr 14, 2021

Dear Zendesk,
We are trying to run your package on IOS real device but we are getting the following error.
Can you please advise us on this issue
Thank you

[VERBOSE-2:ui_dart_state.cc(186)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
[ ] #0 ProfileApi.setVisitorInfo (package:zendesk/src/pigeon.dart:230:7)
[ ]
[ ] #1 Zendesk.setVisitorInfo (package:zendesk/src/zendesk.dart:32:5)
[ ]
[ ] [VERBOSE-2:ui_dart_state.cc(186)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
[ ] #0 ProfileApi.addVisitorTags (package:zendesk/src/pigeon.dart:252:7)
[ ]
[ ] #1 Zendesk.addVisitorTags (package:zendesk/src/zendesk.dart:37:5)
[ ]

@canturkay
Copy link

I'm facing the same issue, are there any updates?

@IanWambai
Copy link

Same here any updates?

@emren
Copy link
Author

emren commented Jun 10, 2021

We have android and ios versions of our app. On android it works fine. On Ios we receive this error. We are using the same key for android and ios. Do we need separate keys for android and ios?

@Jamesweng
Copy link

Same here, any updates?

@kharisazhar
Copy link

Same here any updates? 👀

@kharisazhar
Copy link

kharisazhar commented Oct 1, 2021

Finally i found this solution :

Cause :

PlatformException(channel-error, Unable to establish connection on channel., null, null)

issue from

zendesk
                      .setVisitorInfo(
                    name: 'My Name',
                    phoneNumber: '323-555-1212',
                  )
                      .then((r) {
                    print('setVisitorInfo finished');
                  }).catchError((e) {
                    print('error $e');
                  });

in my case start chat zendesk blocked by

zendesk
                      .setVisitorInfo(
                    name: 'My Name',
                    phoneNumber: '323-555-1212',
                  )
                      .then((r) {
    zendesk.startChat(
                  }).catchError((e) {
                    print('error $e');
                  });

so the solution is separate setVisitorInfo and startChat

 @override
 void initState() {
zendesk
                      .setVisitorInfo(
                    name: 'My Name',
                    phoneNumber: '323-555-1212',
                  )
                      .then((r) {
                    print('setVisitorInfo finished');
                  }).catchError((e) {
                    print('error $e');
                  });
}
}
RaisedButton(
                  child: Text('Start Chat (styled)'),
                  onPressed: () async {
                    zendesk
                        .startChat(
                      iosNavigationBarColor: Colors.red,
                      iosNavigationTitleColor: Colors.yellow,
                    )
                        .then((r) {
                      print('startChat finished');
                    }).catchError((e) {
                      print('error $e');
                    });
                  },
                ),

Thanks

@bhagyashreekhatri
Copy link

@kharisazhar still the above solution which u provided is not working. Issue still persist for iOS Real device

@theakanfecode1
Copy link

Any update on this error please?

@kharisazhar
Copy link

@bhagyashreekhatri @theakanfecode1

can you show your code please ?

in my case, i just separte setVisitor info with startZendesk :

or you can try, just set startZendesk : (because visitor info is provided by Zendesk V2 Chat Bot, before connect with agent, zendesk will be ask your name and phone)

zendesk .startChat( iosNavigationBarColor: Colors.red, iosNavigationTitleColor: Colors.yellow, ) .then((r) { print('startChat finished'); }).catchError((e) { print('error $e'); });

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

7 participants