Executing in Background
If you want to call the telephony
methods in background, you can do in the following ways.
1. Using only Telephony.instance
If you want to continue using Telephony.insatnce
in the background, you will need to make sure that once the app comes back to the front, it again calls Telephony.insatnce
.
2. Use backgroundInstance
If you cannot make sure that the call to instance would be made every time app comes to foreground, or if you would prefer to maintain a separate background instance, you can use Telephony.backgroundInstance
in the background execution context.
Last updated