Closed hanaechahid closed 3 years ago
Feels like URL field is not being passed. Make sure the RNZendesk.init function has url key in it since its required. All the props in init function are required. If you just need chat functionality, use RNZendesk.initChat function instead
but I didn't change the init function, is the same code as ios
Can you post it here?, Just hide the values or put in garbage values
I initialize it in componentdidmount like this:
import RNZendesk from 'react-native-zendesk-v2'
componentDidMount(){
RNZendesk.init({
key: "key",
appId: "appid",
zendeskUrl:"url",
clientId: "mobile_sdk_client"
})
}
and here i start the chat in the same file:
goToChat() {
RNZendesk.startChat({
name: this.props.currentUser.firstName,
email: this.props.currentUser.mail,
phone: this.props.currentUser.phone,
tags: ['tags'],
department: "Your department",
chatOnly: true
});
}
i unlink the library, but i get new issue "Cannot read property startChat of undefined" cause RNZendesk is undefined
You don't need to unlink the library, it will cause issues. Also the exact line says the url being passed is not a string and thus causing issues. Make sure the support url is correct and type is string
if the url is not correct it should not be working on ios, as I said I made one initialization and one configuration in the same file for both ios and android so i dont think the problem is using wrong url.
of linking the library, when I linked it always get url error, and when i unlink it RNZendesk always undefined
I've made a mistake, I should use url instead of zendeskUrl while initialization
thank you for everything @Saranshmalik
Hi @Saranshmalik , it works fine for ios but isnt in android