createThread not creating the thread
CreateThread Method is not creating the thread. It is giving UnSupportedOperationException in Handle Error Block.
NM.thread().createThread("testthread",user).observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<Thread>() {
@Override
public void accept(Thread thread) throws Exception {
InterfaceManager.shared().a.startChatActivityForID(getApplicationContext(),thread.getEntityID());
}
}, new Consumer<Throwable>() {
@Override
public void accept(@NonNull Throwable throwable) throws Exception {
// Handle error
System.out.print(throwable.getMessage());
}
})
User with whom thread is to be created is generated as
StorageManager.shared().fetchEntityWithEntityID(parentId, User.class);
It is returning the user as expected but thread is not getting created.
if below code is used then thread is opening properly.So it seems that if the thread name is passed then the method call is not working.
User user1 = StorageManager.shared().fetchOrCreateEntityWithEntityID(User.class, userid);
List<User> users=new ArrayList<User>();
users.add(user1);
NM.thread().createThread(users)
In the for comment are you passing in a user or a list of users? If you don't pass in an ArrayList you would get a crash. Also, the fetchEntityEithEntityID method looks like this:
DaoCore.fetchEntityWithEntityID(Thread.class, entityID);
Make sure you don't have the entityID and the class reversed.
Overall, just double check all the APIs you're using because this method does work and it's more likely that this issue is caused by a typo in the code.
@myeduapp We could not reproduce this problem in the newest version of Chat SDK, so we will close this issue. If the issue persists, please re-open it.