Comments (13)
The process of initializing Mobilisten is asynchronous in nature.
The initWithAppKey
API comes with a completion closure within which the status of initialization is provided.
APIs like ZohoSalesIQ.Chat.show()
require that Mobilisten is successfully initialized before invocation.
If you wish to open chat immediately after initialization, here is how you can do it;
ZohoSalesIQ.initWithAppKey(appKey, accessKey: accessKey) { (success) in
if success {
ZohoSalesIQ.Chat.show()
}
}
We do have plans to provide an error in return as well in the API. Using the completion closure provided with the initWithAppKey
API should resolve your issue.
from salesiq-mobilisten-ios.
ok, so do you have any method to check whether SDK is initialized or not? So I can check before calling ZohoSalesIQ.Chat.show(). Incase, I have calling init in AppDelegate for example in order to avoid wait for the user when help button tapped in ViewController.
from salesiq-mobilisten-ios.
Yes we do. ZohoSalesIQ.Chat.isEnabled
can be used to check the state.
from salesiq-mobilisten-ios.
Right now faced one more issue, the sdk is initialized while Invoking ZohoSalesIQ.Chat.show() I am getting the following error, and no chat window is visible;
"Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service"
from salesiq-mobilisten-ios.
Hi @ammarmarn, the message shared is not related to the Chat.show()
API or the chat window.
Could you share more details on how and where the API is being invoked?
from salesiq-mobilisten-ios.
In the ViewController I am initializing the SDK, while when support button is pressed then setting some user info and then showing chat window.
override func viewDidLoad() {
ZohoHandler.setupZohoChat()
}
@IBAction func supportBtnTapped(_ sender: UIButton) {
let visitor = VisitorClass.init()
visitor.setName(userName)
visitor.setEmail(email)
ZohoSalesIQ.Chat.show()
}
from salesiq-mobilisten-ios.
If Mobilisten is initialized at the time of invoking the ZohoSalesIQ.Chat.show()
API, everything should work.
Is the button using which the chat is opened made visible only after successful initialization?
I would also like to point out that the visitor information is being incorrectly set in the shared code snippet.
Please set the information as shown below;
ZohoSalesIQ.Visitor.setName(userName)
ZohoSalesIQ.Visitor.setEmail(userEmail)
I would also highly suggest having Mobilisten initialized in the AppDelegate within the application(_:didFinishLaunchingWithOptions:)
method. This way, ZohoSalesIQ.initWithAppKey
is called only once, and not every time an instance of the view controller loads within the viewDidLoad method.
Could you try applying the above suggestions and let us know if everything works as expected?
from salesiq-mobilisten-ios.
Thanks for the suggestions I will incorporate them, one thing want to ask that instead of removing initialization in viewDidLoad() I am thinking to check if SDK is initialized if not then initialize it within the check.
override func viewDidLoad() {
if !ZohoSalesIQ.Chat.isEnabled {
ZohoSalesIQ.initWithAppKey
}
}
from salesiq-mobilisten-ios.
This would not be needed since Chat may be disabled for other reasons as well. For example, if you choose to hide the chat option when operators are offline.
Within the viewDidLoad method of a view controller, the value for ZohoSalesIQ.Chat.isEnabled
alone can be checked and the chat button can then be made visible if it's true and similarly be hidden if the value is false.
from salesiq-mobilisten-ios.
I have splitVC on which Support is an option that's always visible (can't hide it) and can be selected anytime/mulitple times.
And following is simple code when support selected
What do you suggest will be suitable if "ZohoSalesIQ.Chat.isEnabled
" returns false. Shall I then call following. But problem is I don't know when it will return and what if user selected any other side menu option meanwhile popping up chat window later on suddenly will make bad user experience.
ZohoSalesIQ.initWithAppKey(appKey, accessKey: accessKey) { (success) in
if success {
ZohoSalesIQ.Chat.show()
} }
from salesiq-mobilisten-ios.
Apart from above question I got this crash:
"NSInvalidArgumentException: Application tried to present modally a view controller <Mobilisten.LCNavigationController: 0x14a8f9400> that is already being presented by <Marn.BaseSlidingController: 0x14b525590>."
What do you think can be the cause? (although I think this could be when user multiple tap on support button, but if I am trying to reproduce I am not getting this crash though).
from salesiq-mobilisten-ios.
I have splitVC on which Support is an option that's always visible (can't hide it) and can be selected anytime/mulitple times.
And following is simple code when support selected
What do you suggest will be suitable if "
ZohoSalesIQ.Chat.isEnabled
" returns false. Shall I then call following. But problem is I don't know when it will return and what if user selected any other side menu option meanwhile popping up chat window later on suddenly will make bad user experience.ZohoSalesIQ.initWithAppKey(appKey, accessKey: accessKey) { (success) in if success { ZohoSalesIQ.Chat.show() } }
The value for ZohoSalesIQ.Chat.isEnabled
is false when the option to open chat is not to be shown.
The value can be false in the following cases:
- Mobilisten is not initialized.
- The user is IP blocked by an operator.
- All departments are offline and you choose to hide chat during the time.
- If the current time falls outside the configured business hours and you choose to hide chat during the time.
In this case, you may display the "Support" option as disabled (greyed out) or be hidden.
You may refresh the list once when the init completion closure is executed.
from salesiq-mobilisten-ios.
We hope that the API reference provided answers your question. We are closing this issue since it has had no recent activity.
Please feel free to get back to us through the comments in case you have further queries.
Thanks.
from salesiq-mobilisten-ios.
Related Issues (20)
- Use of deprecated UIWebView HOT 1
- SDK Crash in any moment HOT 6
- On 17 Sept 2020 Xcode 12 will be released HOT 2
- Issue: The chat always start on portrait HOT 5
- live chat not sending to panel HOT 1
- Issue:'Mobilisten/Mobilisten.h' file not found HOT 5
- Issue: Cannot create new conversations with specific VisitorID HOT 4
- Issue: No visible @interface for 'LCSharedHandler' declares the selector 'show:' HOT 2
- Issue: Failed to connect to raw.githubusercontent.com port 443: Operation timed out HOT 2
- Issue: kReachabilityChangedNotification ambiguous HOT 2
- Right now faced one more issue, the sdk is initialized but I am getting the following error, and no window is visible; HOT 1
- Issue: Unable to Build Project using the CocoaPod dependency in Xcode 13.1 HOT 5
- Issue: No such module 'Mobilisten'
- Don't know that error HOT 6
- Both ios and Android SDK zoho init fail HOT 3
- App Crash HOT 2
- Issue: [iOS] - How to access Zoho SalesIQ SDK for make an update Launcher Theme? HOT 1
- Issue: Not supported properly for swiftui based projects HOT 3
- The conversations Page has no navigation bar HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from salesiq-mobilisten-ios.