| 3611cc5e | 14-Aug-2020 |
Łukasz Kosmaty <[email protected]> |
[expo-notifications] Not starting an extra thread in the background service (#9726)
# Why
Currently in `ExpoFcmMessagingService` was started a new thread(actually it is the main thread ♂️) t
[expo-notifications] Not starting an extra thread in the background service (#9726)
# Why
Currently in `ExpoFcmMessagingService` was started a new thread(actually it is the main thread ♂️) to do the async job. It's not needed and may lead to bigger problems in the future. I think we should make it sync.
See also https://stackoverflow.com/questions/41067081/does-firebasemessagingservice-run-in-the-background-by-default/41067993#41067993
# How
Make it synchronous ;)
Before:
```
host.exp.exponent E/host.exp.exponent: onMessageReceived
host.exp.exponent E/host.exp.exponent: Thread[Firebase-ExpoFcmMessagingService,5,main]
host.exp.exponent E/host.exp.exponent: onMessageReceived in API
host.exp.exponent E/host.exp.exponent: Thread[main,5,main]
host.exp.exponent E/host.exp.exponent: loading icon
host.exp.exponent E/host.exp.exponent: Thread[main,5,main]
```
Now:
```
host.exp.exponent E/host.exp.exponent: onMessageReceived
host.exp.exponent E/host.exp.exponent: Thread[Firebase-ExpoFcmMessagingService,5,main]
host.exp.exponent E/host.exp.exponent: onMessageReceived in API
host.exp.exponent E/host.exp.exponent: Thread[Firebase-ExpoFcmMessagingService,5,main]
host.exp.exponent E/host.exp.exponent: loading icon
host.exp.exponent E/host.exp.exponent: Thread[Firebase-ExpoFcmMessagingService,5,main]
```
I don't know if we should apply it to the legacy notification too.
# Test Plan
- sending notification via https://expo.io/notifications when the app is backgrounded/kill.
show more ...
|