File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
app/src/huawei/kotlin/org/thoughtcrime/securesms/notifications Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
9
9
import kotlinx.coroutines.launch
10
10
import kotlinx.coroutines.withContext
11
11
import org.session.libsession.messaging.notifications.TokenFetcher
12
+ import org.session.libsignal.utilities.Log
12
13
import javax.inject.Inject
13
14
import javax.inject.Singleton
14
15
@@ -33,9 +34,13 @@ class HuaweiTokenFetcher @Inject constructor(
33
34
34
35
init {
35
36
GlobalScope .launch {
36
- val instanceId = HmsInstanceId .getInstance(context)
37
- withContext(Dispatchers .Default ) {
38
- instanceId.getToken(APP_ID , TOKEN_SCOPE )
37
+ try {
38
+ val instanceId = HmsInstanceId .getInstance(context)
39
+ withContext(Dispatchers .Default ) {
40
+ instanceId.getToken(APP_ID , TOKEN_SCOPE )
41
+ }
42
+ } catch (e: Exception ) {
43
+ Log .e(" HuaweiTokenFetcher" , " Failed to fetch token" , e)
39
44
}
40
45
}
41
46
}
You can’t perform that action at this time.
0 commit comments