Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,11 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />

<application>
<!-- since 2.0.0 optional 可选项,使用一键登录功能必须添加 -->
<!-- since 2.1.1 optional 可选项,通过screenOrientation设置授权页面横竖屏展示 -->
<activity
android:name="com.cmic.sso.sdk.activity.OAuthActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="portrait"
android:launchMode="singleTop">
</activity>
<!-- since 2.0.0 optional 可选项,使用一键登录功能必须添加 -->
<!-- since 2.1.1 optional 可选项,通过screenOrientation设置授权页面横竖屏展示 -->
<activity
android:name="com.cmic.sso.sdk.activity.LoginAuthActivity"
android:theme="@android:style/Theme.Holo.NoActionBar"
android:theme="@style/ActivityDialogStyle"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="portrait"
android:launchMode="singleTop">
Expand All @@ -38,7 +30,7 @@
<!-- since 2.1.1 optional 可选项,通过screenOrientation设置授权页面横竖屏展示 -->
<activity android:name="cn.jiguang.verifysdk.CtLoginActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@android:style/Theme.Holo.NoActionBar"
android:theme="@style/ActivityDialogStyle"
android:screenOrientation="portrait"
android:launchMode="singleTop">
</activity>
Expand Down
4 changes: 4 additions & 0 deletions android/src/main/res/drawable/dialog_bg.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="5dp"/>
</shape>
15 changes: 15 additions & 0 deletions android/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="ActivityDialogStyle" >
<!--去掉action bar和标题栏-->
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<!--背景透明-->
<item name="android:windowIsTranslucent">true</item>
<!--dialog圆角-->
<item name="android:windowBackground">@drawable/dialog_bg</item>

<!--弹窗后整个屏幕的背景是否有遮障层,默认是半透明的-->
<item name="android:backgroundDimEnabled">true</item>
</style>
</resources>
12 changes: 6 additions & 6 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,12 @@ export default class App extends React.Component {
};
JVerification.addLoginEventListener(this.LoginListener);
if(Platform.OS == 'ios'){
this.UnCheckboxEvent = result => {
console.log('UnCheckboxEvent:未选中隐私协议框');
this.createAlert('Listener:未选中隐私协议框' );
}
JVerification.addUncheckBoxEventListener(this.UnCheckboxEvent)
}
this.UnCheckboxEvent = result => {
console.log('UnCheckboxEvent:未选中隐私协议框');
this.createAlert('Listener:未选中隐私协议框' );
}
JVerification.addUncheckBoxEventListener(this.UnCheckboxEvent);
}
}

render() {
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"jcore-react-native": "^1.7.0",
"react": "16.8.6",
"react-native": "0.63.4",
"jverification-react-native": "2.4.5"
"jverification-react-native": "2.4.6"
},
"devDependencies": {
"@babel/core": "^7.5.0",
Expand Down
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const JVerificationModule = NativeModules.JVerificationModule;

const listeners = {};
const LoginEvent = 'LoginEvent'; //登录事件
const UnCheckBox = 'UncheckBoxCallBack'; //iOS 未选中隐私协议CheckBox,点击登录按钮的回调事件

export default class JVerification {

Expand Down Expand Up @@ -238,6 +239,13 @@ export default class JVerification {
});
}

static addUncheckBoxEventListener(callback) {
listeners[callback] = DeviceEventEmitter.addListener(
UnCheckBox, result => {
callback(result);
});
}

//移除事件
static removeListener(callback) {
if (!listeners[callback]) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"license": "ISC",
"author": "wicked.tc130",
"version": "2.4.5",
"version": "2.4.6",
"repository": {
"type": "git",
"url": "https://github.com/jpush/jverification-react-native"
Expand Down