Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get the identity value #14

Open
Aruldevi429 opened this issue Aug 2, 2019 · 0 comments
Open

Can't get the identity value #14

Aruldevi429 opened this issue Aug 2, 2019 · 0 comments

Comments

@Aruldevi429
Copy link

Aruldevi429 commented Aug 2, 2019

Hello, I would like to say the app looks awesome!
I ran into a compilation issue on the way to work that I thought I would file here.

Got identity values were nil.

func login() {
    
    TwilioChatClient.setLogLevel(.debug)

    // Fetch Access Token from the server and initialize Chat Client - this assumes you are running
    // the PHP starter app on your local machine, as instructed in the quick start guide
    let deviceId = UIDevice.current.identifierForVendor!.uuidString
    let urlString = "\(tokenURL)?identity=\(identity)&device=\(deviceId)"
    
    TokenUtils.retrieveToken(url: urlString) { (token, identity, error) in
       
        if let token = identity {
            // Set up Twilio Chat client
            TwilioChatClient.chatClient(withToken: token, properties: nil, delegate: self) {
                (result, chatClient) in
                    self.client = chatClient;
                    // Update UI on main thread
                    DispatchQueue.main.async() {
                        self.navigationItem.prompt = "Logged in as \"\(self.identity)\""
                 }
            }
        } else {
            print("Error retrieving token: \(error.debugDescription)")
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant