Info: I'm using iOS 14.6, in Xcode 12.5, and I'm using the SDK version 1.0.13 taken from Cocoapods.
So the product I'm integrating the Crisp chat is available on both iOS and Android.
In the Android version, the other developers already used the nickname with format "[name] ([role] / [userID])". But in the iOS version, I set it as "[name]" only, because the "role" and "userID" will be put as the visitor data.
However, I forgot that in our product, the user name is optional, thus in iOS it'll automatically sent as an empty string.
Then, I changed the implementation to avoid the nickname to be set as empty string from the iOS version. However, every time I opened ChatViewController(), it keeps showing the "Error starting chat" alert. Like the picture below.
On the console, it prints:
[error] (Parsing) Missing field 'nickname' in class Participant
I already fixed for further using, but for this particular account, it's kinda too late to fix it since it seems that the empty string has already been recorded although I've changed the user name to not be empty.
So in summary, the steps to reproduce are:
- Feature developed in Android first, with nickname set with format
[name] ([role] / [userID])
.
- The user without a username, accessed the Crisp chat page on Android first. Nickname recorded as
([role] / [id]
(a space at the beginning is because the name is empty. Then send a message from Android.
- Feature developed in iOS then, with nickname set with format
[name]
.
- The same user opens Crisp chat page on iPhone, at first open it behaved normally.
- The user close the page on iPhone.
- The user open the Crisp chat page again on iPhone.
- The error alert appeared, and the error message
[error] (Parsing) Missing field 'nickname' in class Participant
showed on console.
The problem is that in Android, the error doesn't shown, but only in iOS version. Please help me solve this issue. Thanks!