4
4
import android .content .Intent ;
5
5
import android .net .Uri ;
6
6
import android .os .Build ;
7
+ import android .os .Handler ;
8
+ import android .os .Looper ;
7
9
import com .facebook .react .bridge .Promise ;
8
10
import com .facebook .react .bridge .ReactApplicationContext ;
9
11
import com .facebook .react .bridge .ReactContext ;
17
19
public class UpdateModule extends NativePushySpec {
18
20
UpdateContext updateContext ;
19
21
public static ReactApplicationContext mContext ;
22
+ private final Handler handler = new Handler (Looper .getMainLooper ());
20
23
public UpdateModule (ReactApplicationContext reactContext , UpdateContext updateContext ) {
21
24
super (reactContext );
22
25
this .updateContext = updateContext ;
@@ -38,12 +41,22 @@ protected Map<String, Object> getTypedExportedConstants() {
38
41
boolean isFirstTime = updateContext .isFirstTime ();
39
42
constants .put ("isFirstTime" , isFirstTime );
40
43
if (isFirstTime ) {
41
- updateContext .clearFirstTime ();
44
+ handler .postDelayed (new Runnable () {
45
+ @ Override
46
+ public void run () {
47
+ updateContext .clearFirstTime ();
48
+ }
49
+ }, 2000 );
42
50
}
43
51
String rolledBackVersion = updateContext .rolledBackVersion ();
44
52
constants .put ("rolledBackVersion" , rolledBackVersion );
45
53
if (rolledBackVersion != null ) {
46
- updateContext .clearRollbackMark ();
54
+ handler .postDelayed (new Runnable () {
55
+ @ Override
56
+ public void run () {
57
+ updateContext .clearRollbackMark ();
58
+ }
59
+ }, 2000 );
47
60
}
48
61
constants .put ("uuid" , updateContext .getKv ("uuid" ));
49
62
return constants ;
0 commit comments