Open v-yer opened 3 years ago
Hi, So I looked upon the issue and seems like while I did do that for Support SDK since it was required there, I missed the same for the Chat SDK. I am looking to build a new version, and will fix this in that version but I can't commit on a date as of now, if you need it urgently, I would say to follow the steps here https://developer.zendesk.com/embeddables/docs/ios-unified-sdk/sdk_identify_users#chat-sdk-optional and here https://developer.zendesk.com/embeddables/docs/android-unified-sdk/sdk_identify_users#chat-sdk-optional Basically all you go to do is on set user identity function you need to call in an additional function to register it with the ChatProvider as well. Anyhow adding it to the next release work, on this PR #12 .
Okay so zendesk provides methods to use jwt authentication but expects the user to create payload and call the api on own and pass the fetched token to the chat client. Calling api from native module will make the library code complex and it is not ideal. So here is what I plan to implement, user will fetch token on own and pass the created token for zendesk on setUserIdentity, the library would store the token and pass it on to the chat client, the responsibility to generate token and get a new one on expiry will be on you. So before starting a chat you would need to ensure your last token is alive if not, fetch a new and call setUserIdentity again before starting the chat. Thoughts or better suggestions?
currently setUserIdentity is not defined in the index.d.ts, I've seen a pr related to that, should that be merged?
Hi, we need to set user identity with JWT token, but however everything is set in accordance with documentation, JWT identification does not work. The identity is set after
RNZendeskChat.init()
like this:Starting chat with these options:
In Zendesk Support Mobile SDK settings authentication metod is set to JWT and rest of settings are also done.
After enabling logs on Android app:
But still there is no call from Zendesk to our JWT endpoint and user authentication seems to be still anonymous. Is there anything else what should be set to make it work? Thanks for any help.