@@ -91,76 +91,76 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
91
91
92
92
if (action .equals ("setDebug" )) {
93
93
if (args .length () == 1 ) {
94
- cordova .getThreadPool ().execute (r );
94
+ cordova .getActivity ().runOnUiThread (r );
95
95
}
96
96
return true ;
97
97
} else if (action .equals ("initSession" )) {
98
- cordova .getThreadPool ().execute (r );
98
+ cordova .getActivity ().runOnUiThread (r );
99
99
return true ;
100
100
} else if (action .equals ("setMixpanelToken" )) {
101
- cordova .getThreadPool ().execute (r );
101
+ cordova .getActivity ().runOnUiThread (r );
102
102
return true ;
103
103
} else {
104
104
if (this .instance != null ) {
105
105
if (action .equals ("setIdentity" )) {
106
- cordova .getThreadPool ().execute (r );
106
+ cordova .getActivity ().runOnUiThread (r );
107
107
return true ;
108
108
} else if (action .equals ("userCompletedAction" )) {
109
109
if (args .length () < 1 && args .length () > 2 ) {
110
110
callbackContext .error (String .format ("Parameter mismatched. 1-2 is required but %d is given" , args .length ()));
111
111
return false ;
112
112
}
113
- cordova .getThreadPool ().execute (r );
113
+ cordova .getActivity ().runOnUiThread (r );
114
114
return true ;
115
115
} else if (action .equals ("sendCommerceEvent" )) {
116
116
if (args .length () < 1 && args .length () > 2 ) {
117
117
callbackContext .error (String .format ("Parameter mismatched. 1-2 is required but %d is given" , args .length ()));
118
118
return false ;
119
119
}
120
- cordova .getThreadPool ().execute (r );
120
+ cordova .getActivity ().runOnUiThread (r );
121
121
return true ;
122
122
} else if (action .equals ("getFirstReferringParams" )) {
123
- cordova .getThreadPool ().execute (r );
123
+ cordova .getActivity ().runOnUiThread (r );
124
124
return true ;
125
125
} else if (action .equals ("getLatestReferringParams" )) {
126
- cordova .getThreadPool ().execute (r );
126
+ cordova .getActivity ().runOnUiThread (r );
127
127
return true ;
128
128
} else if (action .equals ("logout" )) {
129
- cordova .getThreadPool ().execute (r );
129
+ cordova .getActivity ().runOnUiThread (r );
130
130
return true ;
131
131
} else if (action .equals ("loadRewards" )) {
132
- cordova .getThreadPool ().execute (r );
132
+ cordova .getActivity ().runOnUiThread (r );
133
133
return true ;
134
134
} else if (action .equals ("redeemRewards" )) {
135
135
if (args .length () < 1 && args .length () > 2 ) {
136
136
callbackContext .error (String .format ("Parameter mismatched. 1-2 is required but %d is given" , args .length ()));
137
137
return false ;
138
138
}
139
- cordova .getThreadPool ().execute (r );
139
+ cordova .getActivity ().runOnUiThread (r );
140
140
return true ;
141
141
} else if (action .equals ("getCreditHistory" )) {
142
- cordova .getThreadPool ().execute (r );
142
+ cordova .getActivity ().runOnUiThread (r );
143
143
return true ;
144
144
} else if (action .equals ("createBranchUniversalObject" )) {
145
145
if (args .length () != 1 ) {
146
146
callbackContext .error (String .format ("Parameter mismatched. 1 is required but %d is given" , args .length ()));
147
147
return false ;
148
148
}
149
- cordova .getThreadPool ().execute (r );
149
+ cordova .getActivity ().runOnUiThread (r );
150
150
return true ;
151
151
} else if (action .equals (("generateShortUrl" ))) {
152
152
if (args .length () != 3 ) {
153
153
callbackContext .error (String .format ("Parameter mismatched. 3 is required but %d is given" , args .length ()));
154
154
return false ;
155
155
}
156
- cordova .getThreadPool ().execute (r );
156
+ cordova .getActivity ().runOnUiThread (r );
157
157
return true ;
158
158
} else if (action .equals ("registerView" )) {
159
159
if (args .length () != 1 ) {
160
160
callbackContext .error (String .format ("Parameter mismatched. 1 is required but %d is given" , args .length ()));
161
161
return false ;
162
162
}
163
- cordova .getThreadPool ().execute (r );
163
+ cordova .getActivity ().runOnUiThread (r );
164
164
return true ;
165
165
} else if (action .equals ("showShareSheet" )) {
166
166
if (args .length () < 3 ) {
0 commit comments