Daniel
03/02/2023, 9:30 AMsuspend fun getUserProfileAndInsertFCMTokenForIOS(token: String): CommonFlow<UserInfo?> {
val userId = appService.currentUser!!.id
val userdata = realm.query<UserInfo>("_id = $0", userId).asFlow().map {
it.list.firstOrNull()
}.asCommonFlow()
realm.write {
var user = query<UserInfo>("_id = $0", userId).first().find()
if (user != null) {
user = findLatest(user)!!.also {
if (!it.FCMToken.contains(token)) it.FCMToken.add(token)
}
copyToRealm(user)
}
}
return userdata
}
When I call after the login, I am getting: _*'async' call in a function that does not support concurrency*_:
Here:
https://files.slack.com/files-pri/T09229ZC6-F04S0HTCAF5/screenshot_2023-03-02_at_11.28.15.png▾