Skip to content

Commit b1bcac1

Browse files
authored
Merge pull request #23 from jpush/dev
升级到v2.4.6
2 parents 494e262 + 3fc18ff commit b1bcac1

File tree

7 files changed

+37
-18
lines changed

7 files changed

+37
-18
lines changed

android/src/main/AndroidManifest.xml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,11 @@
1717
<uses-permission android:name="android.permission.WAKE_LOCK" />
1818

1919
<application>
20-
<!-- since 2.0.0 optional 可选项,使用一键登录功能必须添加 -->
21-
<!-- since 2.1.1 optional 可选项,通过screenOrientation设置授权页面横竖屏展示 -->
22-
<activity
23-
android:name="com.cmic.sso.sdk.activity.OAuthActivity"
24-
android:configChanges="orientation|keyboardHidden|screenSize"
25-
android:screenOrientation="portrait"
26-
android:launchMode="singleTop">
27-
</activity>
2820
<!-- since 2.0.0 optional 可选项,使用一键登录功能必须添加 -->
2921
<!-- since 2.1.1 optional 可选项,通过screenOrientation设置授权页面横竖屏展示 -->
3022
<activity
3123
android:name="com.cmic.sso.sdk.activity.LoginAuthActivity"
32-
android:theme="@android:style/Theme.Holo.NoActionBar"
24+
android:theme="@style/ActivityDialogStyle"
3325
android:configChanges="orientation|keyboardHidden|screenSize"
3426
android:screenOrientation="portrait"
3527
android:launchMode="singleTop">
@@ -38,7 +30,7 @@
3830
<!-- since 2.1.1 optional 可选项,通过screenOrientation设置授权页面横竖屏展示 -->
3931
<activity android:name="cn.jiguang.verifysdk.CtLoginActivity"
4032
android:configChanges="orientation|keyboardHidden|screenSize"
41-
android:theme="@android:style/Theme.Holo.NoActionBar"
33+
android:theme="@style/ActivityDialogStyle"
4234
android:screenOrientation="portrait"
4335
android:launchMode="singleTop">
4436
</activity>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android">
3+
<corners android:radius="5dp"/>
4+
</shape>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<style name="ActivityDialogStyle" >
4+
<!--去掉action bar和标题栏-->
5+
<item name="android:windowActionBar">false</item>
6+
<item name="android:windowNoTitle">true</item>
7+
<!--背景透明-->
8+
<item name="android:windowIsTranslucent">true</item>
9+
<!--dialog圆角-->
10+
<item name="android:windowBackground">@drawable/dialog_bg</item>
11+
12+
<!--弹窗后整个屏幕的背景是否有遮障层,默认是半透明的-->
13+
<item name="android:backgroundDimEnabled">true</item>
14+
</style>
15+
</resources>

example/App.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,12 @@ export default class App extends React.Component {
246246
};
247247
JVerification.addLoginEventListener(this.LoginListener);
248248
if(Platform.OS == 'ios'){
249-
this.UnCheckboxEvent = result => {
250-
console.log('UnCheckboxEvent:未选中隐私协议框');
251-
this.createAlert('Listener:未选中隐私协议框' );
252-
}
253-
JVerification.addUncheckBoxEventListener(this.UnCheckboxEvent)
254-
}
249+
this.UnCheckboxEvent = result => {
250+
console.log('UnCheckboxEvent:未选中隐私协议框');
251+
this.createAlert('Listener:未选中隐私协议框' );
252+
}
253+
JVerification.addUncheckBoxEventListener(this.UnCheckboxEvent);
254+
}
255255
}
256256

257257
render() {

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"jcore-react-native": "^1.7.0",
1111
"react": "16.8.6",
1212
"react-native": "0.63.4",
13-
"jverification-react-native": "2.4.5"
13+
"jverification-react-native": "2.4.6"
1414
},
1515
"devDependencies": {
1616
"@babel/core": "^7.5.0",

index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const JVerificationModule = NativeModules.JVerificationModule;
88

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

1213
export default class JVerification {
1314

@@ -238,6 +239,13 @@ export default class JVerification {
238239
});
239240
}
240241

242+
static addUncheckBoxEventListener(callback) {
243+
listeners[callback] = DeviceEventEmitter.addListener(
244+
UnCheckBox, result => {
245+
callback(result);
246+
});
247+
}
248+
241249
//移除事件
242250
static removeListener(callback) {
243251
if (!listeners[callback]) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "index.js",
66
"license": "ISC",
77
"author": "wicked.tc130",
8-
"version": "2.4.5",
8+
"version": "2.4.6",
99
"repository": {
1010
"type": "git",
1111
"url": "https://github.com/jpush/jverification-react-native"

0 commit comments

Comments
 (0)