ERROR - [HTTP 401] - Failed Identity Verification check
Shimmer shows for a while and then gets the error Content could not be loaded.
Facing error ERROR - [HTTP 401] - Failed Identity Verification check when trying to open Messenger.
This happens for both loginIdentifiedUser and loginUnidentifiedUser. This happens for all functions of the intercom not only the messenger, and help desk.
P.S: In intercom console. We have enabled identity verification.
As you have enabled the identity verification so you have to set the user hash before loginIdentifiedUser.
See https://pub.dev/documentation/intercom_flutter/latest/intercom_flutter/Intercom/setUserHash.html
But it should not be the problem with Unidentified users.
Thanks for the response @deepak786 .
Update from my side: I tried this same code after about 7 hours and it started working with UnidentifedUser only. I had a chat and it was working fine. But then after some time, it started to appear again and till now I am stuck with this. Same code nothing changed.
Are you executing the whole code, visible in the screenshot, on click?
@deepak786
Sorry for the late response. Same behaviour still.
It was working fine with an unidentified user but then I shifted it to the identified user and it worked in debug mode for me. But in the release build, I am again facing this issue.
It is never stable, it start working automatically and then goes away with the exception:
Failed Identity Verification check
Any possible updates on this?
For the identified user, first generate a user_hash either with user_id or email (which is being used in loginIdentifiedUser). And then call the API setUserHash
// generate user hash. see https://gist.github.com/thewheat/7342c76ade46e7322c3e?permalink_comment_id=4575730#gistcomment-4575730
String userHash = "";
// set the userHash
Intercom.instance.setUserHash(userHash).then((value) {
// login
return Intercom.instance.loginIdentifiedUser(
userId: "",
statusCallback: IntercomStatusCallback(
onSuccess: () {
debugPrint("Login successful");
},
onFailure: (e) {
debugPrint("Login Error >>>> ${e.toString()}");
},
),
);
}).then((value) {
// display messenger
return Intercom.instance.displayMessenger();
});
Hi @deepak786, thanks for the response. I'm working on the same project as @adilexperience did and can confirm that your solution above is still not working.
Hey @deepak786 after reviewing everything the setup, I can say that the wrong secret key was used for Android when generating hash. Different secret keys are provided dependent on the platform as can be seen in Intercom Dashboard Settings -> Workspace -> Security -> Enforce Identity. This issue can be closed