Hi,
Just following the getting started docs to try and get the chat showing in app... https://developer.genesys.cloud/commdigital/digital/webmessaging/mobile-messaging/messenger-mobile-sdk/ios/
I have the view controller here...
import UIKit
import GenesysCloud
class GenesysChatViewController: UIViewController {
var chatController: ChatController!
var chatVC: UINavigationController!
override func viewDidLoad() {
super.viewDidLoad()
let messengerAccount = MessengerAccount(
deploymentId: "<REDACTED>",
domain: "eu-west-2",
logging: true
)
chatController = ChatController(account: messengerAccount)
chatController.delegate = self
}
@objc func dismissChat(_ sender: UIBarButtonItem?) {
chatController.terminate()
}
}
extension GenesysChatViewController: ChatControllerDelegate {
func shouldPresentWelcomeMessage() -> Bool {
true
}
func shouldPresentChatViewController(_ viewController: UINavigationController!) {
viewController.modalPresentationStyle = .overFullScreen
present(viewController, animated: true) {
viewController.viewControllers.first?.navigationItem.leftBarButtonItem = UIBarButtonItem(
title: "End Chat",
style: .plain,
target: self,
action: #selector(GenesysChatViewController.dismissChat(_:))
)
}
}
func didFailWithError(_ error: GCError!) {
print(error.error.debugDescription)
}
}
And when I present or show this view controller I get an empty/transparent view pushed and the associated shouldPresentChatViewController
function doesn't seem to be called.
Please could you advise on where I'm going wrong.
Thanks