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

kotlin exception when creating users #190

Open
dinaomar opened this issue Mar 10, 2020 · 1 comment
Open

kotlin exception when creating users #190

dinaomar opened this issue Mar 10, 2020 · 1 comment

Comments

@dinaomar
Copy link

dinaomar commented Mar 10, 2020

hi there , i'm using your library with kotlin but when trying to receive message from remote the app crash with lateinit property user has not been initialized
and the error reference to this line lateinit var user: IChatUser in Message class

library version 2.0.1
any solution ?

@blackcolt
Copy link

the IChatUser is an interface, you need to implement it in your user class
open class User : IChatUser
And in the message setUser you need to insert your user (I had to add as IChatUser for it to work).

 val me = User.sharedUser as IChatUser
val message: Message = Message.Builder()
                .setUser(me)
                .setRight(true)
                .setText(chatView.inputText)
                .hideIcon(true)
                .build()
            logger.debug { message }

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

2 participants