Chat View Controller appears to be blank and transparent

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

Oh! I keep hitting the didFailWithError function. With the error...

"Exception in http request: Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found."

With the URL...

https://api-cdn.eu-west-2/webdeployments/v1/deployments/<REDACTED>/config.json

I think maybe the domain is wrong? But I'm not sure where to get the domain from?

Thanks

Hi,

If you check the url, you have inserted in your comment, it is

https://api-cdn.eu-west-2

It seems you are missing some .com or other country code, right?

Solved, thanks.

We're using euw2.pure.cloud

Great. Thank you for the feedback.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.