await FlutterFreshchat.identifyUser() is returning empty string when restoreId is not passed
await FlutterFreshchat.identifyUser(
externalID: accountId,
restoreID: null,
);
returns an empty string every time instead of restoreId generated by Freshchat.
PS: I am using the free plan of FreshChat
This was tested on Android
@daadu try passing an empty string rather than null to restoreId
Strange. The Activity gets killed or something at times. Anyways, still, the same issue returning an empty string.
@daadu I looked through the issue it doesn't generate a restoreId unless you start a conversation after that if you identify the user you should get a restoreId. I think this has to with Freshchat, not with this plugin as it is stated in the Freshchat Android docs: "Restore Id for a user is typically generated only when the user has sent a message."
Also, you can pass null to the identifyUser method that should work too.
Strange! anyways I will implement that way and test.Till then keep this issue open.
In my current flow, I identify -> then add user detail -> then start conversation. I guess I should add user detail -> then start conversation -> then identify.
This will also wont work if you are trying to sync conversations so I think the best way would be to check if the user has a restoreId stored locally or the server if he has identify the user or if not start the conversation and then identify.
@daadu going to close this issue if the problem persists feel free to open the issue again
@fayeed Not working. Sorry for responding late.
Empty string returned by FlutterFreshchat.identifyUser even after a conversation is initiated and responded.
I have re-opened this issue again but I don't have time to work on it if you can fix this please do create a pull request or wait till someone else or I fix this.
@daadu I just checked this issue I see no problem, It might be because you also need to update the user info.
Here I tested it and its working:

getting an empty string from identifyUser for my credentials. My freshchat account is on the free plan (not trial). I am guessing the issue could be related to this.
I am also facing the same issue...did you find a fix?
No, it looks like the issue because of free plan. Although not sure.
As per docs. Restore Id is asynchronous and typically only initiated when conversion starts for first time. So as per their sample app and docs. We have to create Broadcast receiver on android so when it's created for first time. It will be passed by broadcast receiver. (I'm not sure of ios though) And then from native android we can call a flutter method which will give restore id when it becomes available.
by changing restoreId == "" to restoreId.equals("") in FlutterFreshchatPlugin in android module, empty restoreId issue will be resolved
by changing restoreId == "" to restoreId.equals("") in FlutterFreshchatPlugin in android module, empty restoreId issue will be resolved
How about iOS?? I am having issues with the FlutterFreshchat.identifyUser. Prints this error Could not cast value of type 'NSNull' (0x7fff86b92b38) to 'NSString' (0x7fff86bb7bb0). And crashes when it tries to identify user. What values do I use for externalID and restoreID to prevent crash..