Skip to content

Commit 9177d4e

Browse files
committed
修复认证android dismissLoginAuthActivity方法不在主线调用导致的崩溃
1 parent 479b1b5 commit 9177d4e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

android/src/main/java/cn/jiguang/plugins/verification/JVerificationModule.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,13 @@ public void onEvent(int code, String content) {
130130

131131
@ReactMethod
132132
public void dismissLoginAuthActivity(){
133-
JVerificationInterface.dismissLoginAuthActivity();
133+
reactContext.runOnUiQueueThread(new Runnable() {
134+
@Override
135+
public void run() {
136+
JVerificationInterface.dismissLoginAuthActivity();
137+
}
138+
});
139+
134140
}
135141

136142
@ReactMethod

example/App.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,13 @@ export default class App extends React.Component {
245245
console.log('LoginListener:' + JSON.stringify(result));
246246
};
247247
JVerification.addLoginEventListener(this.LoginListener);
248+
if(Platform.OS == 'ios'){
248249
this.UnCheckboxEvent = result => {
249250
console.log('UnCheckboxEvent:未选中隐私协议框');
250251
this.createAlert('Listener:未选中隐私协议框' );
251252
}
252253
JVerification.addUncheckBoxEventListener(this.UnCheckboxEvent)
254+
}
253255
}
254256

255257
render() {
@@ -299,7 +301,7 @@ export default class App extends React.Component {
299301
<Button title='自定义弹窗授权页'
300302
onPress={() => {
301303
if(Platform.OS == 'android'){
302-
JVerification.addLoginCustomConfig(androidDialogConfig, undefined);
304+
JVerification.addLoginCustomConfig(androidDialogConfig, customViewParams);
303305
} else {
304306
JVerification.addLoginCustomConfig(iosDialogConfig, customViewParams);
305307
}

0 commit comments

Comments
 (0)