|
@@ -9,6 +9,7 @@ import {
|
9
|
9
|
NativeAppEventEmitter,
|
10
|
10
|
Platform,
|
11
|
11
|
AsyncStorage,
|
|
12
|
+ AppState,
|
12
|
13
|
} from 'react-native'
|
13
|
14
|
import type {
|
14
|
15
|
RNFetchBlobNative,
|
|
@@ -44,7 +45,13 @@ const {
|
44
|
45
|
|
45
|
46
|
const Blob = polyfill.Blob
|
46
|
47
|
const emitter = DeviceEventEmitter
|
47
|
|
-const RNFetchBlob= NativeModules.RNFetchBlob
|
|
48
|
+const RNFetchBlob = NativeModules.RNFetchBlob
|
|
49
|
+
|
|
50
|
+AppState.addEventListener('change', (e) => {
|
|
51
|
+ console.log('app state changed', e)
|
|
52
|
+ if(e === 'active')
|
|
53
|
+ RNFetchBlob.emitExpiredEvent(()=>{})
|
|
54
|
+})
|
48
|
55
|
|
49
|
56
|
// register message channel event handler.
|
50
|
57
|
emitter.addListener("RNFetchBlobMessage", (e) => {
|