Skip to content

Commit 3b4c5fa

Browse files
author
sherry
committed
ios add login dialog
1 parent f1b59e5 commit 3b4c5fa

File tree

5 files changed

+121
-95
lines changed

5 files changed

+121
-95
lines changed

example/App.js

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@ const customConfigParams = {
140140
privacyWebNavTitleSize: 16, //协议页导航栏标题字体大小
141141
privacyWebNavTitleColor: -1, //协议页导航栏标题字体颜色
142142
privacyWebNavReturnImage: 'close', //协议页导航栏返回按钮图片
143-
privacyNeedStartAnim: true, //设置拉起授权页时是否需要显示默认动画 默认展示
144-
privacyNeedCloseAnim: true, //设置关闭授权页时是否需要显示默认动画 默认展示
145-
privacyDialogTheme: [300, 700, 0, 0, false], //授权页弹窗模式
146143
};
147144

148145
const customViewParams = [
@@ -158,19 +155,36 @@ const codeConfig = {
158155
};
159156
//安卓授权页弹窗模式
160157
const androidDialogConfig = {
161-
privacyDialogTheme: [300, 700, 0, 0, false], //授权页弹窗模式
158+
privacyDialogTheme: [300, 400, 0, 0, false], //授权页弹窗模式
159+
privacyNeedStartAnim: true, //设置拉起授权页时是否需要显示默认动画 默认展示
160+
privacyNeedCloseAnim: true, //设置关闭授权页时是否需要显示默认动画 默认展示
161+
navColor:0xff000000,
162+
loginBtnText:" 极光认证测试 ",
163+
privacyCheckEnable:false,
164+
privacyColor:[0xff00f000,0xff000000]
162165
}
163166
//ios授权页弹窗模式
164167
const iosDialogConfig = {
168+
navHidden:true, //导航栏是否隐藏
169+
logoImage: 'umcsdk_mobile_logo', //logo(android默认为应用图标;ios默认无)
170+
logoConstraints:[0,-100,60,60], //LOGO图片布局对象
171+
logoHidden: false, //logo是否隐藏
172+
numberConstraints:[0,-42,200,14], //号码栏布局对象
173+
sloganConstraints:[0,-20,200,14], //slogan布局对象
174+
logBtnConstraints:[0,20,220,40],
175+
loginBtnText: '登录按钮', //登录按钮文字
176+
loginBtnTextSize: 16, //登录按钮字体大小
177+
loginBtnTextColor: -16777216, //登录按钮文字颜色
178+
privacyConstraints:[0,100,200,40], //隐私条款布局对象
179+
checkViewConstraints:[-108,100,10,10], //checkBox布局对象
180+
loadingConstraints:[0,0,20,20],
165181
showWindow:true, // 是否弹窗,默认no
166-
windowBackgroundImage:"static/bg.jpeg", // 弹框内部背景图片
182+
windowBackgroundImage:"bg", // 弹框内部背景图片
167183
windowBackgroundAlpha: 0.3, //弹窗外侧 透明度 0~1.0
168184
windowCornerRadius:10, //弹窗圆角数值
169185
windowConstraints:[0,0,300,300], //弹窗布局对象
170-
windowHorizontalConstraints:[],//弹窗横屏布局,横屏下优先级高于windowConstraints
171-
windowCloseBtnImgs:["static/windowClose","static/windowClose"],//弹窗close按钮图片 @[普通状态图片,高亮状态图片]
186+
windowCloseBtnImgs:["windowClose","windowClose"],//弹窗close按钮图片 @[普通状态图片,高亮状态图片]
172187
windowCloseBtnConstraints:[-135,-135,20,20],//弹窗close按钮布局,
173-
windowCloseBtnHorizontalConstraints:[], //弹窗close按钮 横屏布局,横屏下优先级高于windowCloseBtnConstraints
174188
}
175189

176190
export default class App extends React.Component {
@@ -215,17 +229,16 @@ export default class App extends React.Component {
215229
})}/>
216230

217231
<Button title='addLoginCustomConfig'
218-
onPress={() => JVerification.addLoginCustomConfig(customConfigParams, customViewParams)}/>
232+
onPress={() => JVerification.addLoginCustomConfig(customConfigParams, customViewParams)}/>
219233

220234
<Button title='自定义弹窗授权页'
221235
onPress={() => {
222236
if(Platform.OS == 'android'){
223-
const params = Object.assign({},androidDialogConfig,customConfigParams);
224-
JVerification.addLoginCustomConfig((params, customViewParams))
237+
// const params = Object.assign(androidDialogConfig,customConfigParams);
238+
console.log('androidDialogConfig>>>>',JSON.stringify(androidDialogConfig),'>>>>>')
239+
JVerification.addLoginCustomConfig(androidDialogConfig, []);
225240
} else {
226-
const params = Object.assign({},iosDialogConfig,customConfigParams);
227-
JVerification.addLoginCustomConfig((params, customViewParams))
228-
console.log(params,'params>>>>')
241+
JVerification.addLoginCustomConfig(iosDialogConfig, []);
229242
}
230243
}}/>
231244

example/static/bg.jpeg renamed to example/ios/JVerificationResource.bundle/bg.png

File renamed without changes.

example/static/windowClose.png renamed to example/ios/JVerificationResource.bundle/windowClose.png

File renamed without changes.

example/ios/example.xcodeproj/project.pbxproj

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
1212
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
1313
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
14+
2F80326E524797117E2A71FD /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C89EEBB82D38E81795406DB7 /* libPods-example.a */; };
1415
5C103CA923605A2F000AD3DA /* JVerificationResource.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 5C103CA823605A2E000AD3DA /* JVerificationResource.bundle */; };
15-
8F50AC09F15F86FA5489354E /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 43463078A3605CD1BF6F8ED4 /* libPods-example.a */; };
1616
/* End PBXBuildFile section */
1717

1818
/* Begin PBXContainerItemProxy section */
@@ -43,12 +43,12 @@
4343
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = "<group>"; };
4444
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = "<group>"; };
4545
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = example/main.m; sourceTree = "<group>"; };
46-
34AADD6936D2106EB77FC30D /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = "<group>"; };
47-
43463078A3605CD1BF6F8ED4 /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
46+
22AACBBE82D2DDD05C1CABEF /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = "<group>"; };
4847
5C103CA823605A2E000AD3DA /* JVerificationResource.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = JVerificationResource.bundle; sourceTree = "<group>"; };
4948
5CE4DCC423740560004FE764 /* RCTJCoreModule.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTJCoreModule.xcodeproj; path = "../node_modules/jcore-react-native/ios/RCTJCoreModule.xcodeproj"; sourceTree = "<group>"; };
5049
5CE4DCCA2374057B004FE764 /* RCTJVerificationModule.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTJVerificationModule.xcodeproj; path = "../node_modules/jverification-react-native/ios/RCTJVerificationModule.xcodeproj"; sourceTree = "<group>"; };
51-
CC539E79261FD03377281B08 /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = "<group>"; };
50+
B6D6982FDB9C47421B528899 /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = "<group>"; };
51+
C89EEBB82D38E81795406DB7 /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
5252
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
5353
ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
5454
/* End PBXFileReference section */
@@ -58,7 +58,7 @@
5858
isa = PBXFrameworksBuildPhase;
5959
buildActionMask = 2147483647;
6060
files = (
61-
8F50AC09F15F86FA5489354E /* libPods-example.a in Frameworks */,
61+
2F80326E524797117E2A71FD /* libPods-example.a in Frameworks */,
6262
);
6363
runOnlyForDeploymentPostprocessing = 0;
6464
};
@@ -102,16 +102,16 @@
102102
children = (
103103
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
104104
ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
105-
43463078A3605CD1BF6F8ED4 /* libPods-example.a */,
105+
C89EEBB82D38E81795406DB7 /* libPods-example.a */,
106106
);
107107
name = Frameworks;
108108
sourceTree = "<group>";
109109
};
110110
55DEA14607BD4FAA459AFEAB /* Pods */ = {
111111
isa = PBXGroup;
112112
children = (
113-
CC539E79261FD03377281B08 /* Pods-example.debug.xcconfig */,
114-
34AADD6936D2106EB77FC30D /* Pods-example.release.xcconfig */,
113+
22AACBBE82D2DDD05C1CABEF /* Pods-example.debug.xcconfig */,
114+
B6D6982FDB9C47421B528899 /* Pods-example.release.xcconfig */,
115115
);
116116
path = Pods;
117117
sourceTree = "<group>";
@@ -171,7 +171,7 @@
171171
isa = PBXNativeTarget;
172172
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */;
173173
buildPhases = (
174-
8B11E76F60D07235AA69D1F1 /* [CP] Check Pods Manifest.lock */,
174+
710033BFDB2DA5AA5DFE56E0 /* [CP] Check Pods Manifest.lock */,
175175
FD10A7F022414F080027D42C /* Start Packager */,
176176
13B07F871A680F5B00A75B9A /* Sources */,
177177
13B07F8C1A680F5B00A75B9A /* Frameworks */,
@@ -276,7 +276,7 @@
276276
shellPath = /bin/sh;
277277
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
278278
};
279-
8B11E76F60D07235AA69D1F1 /* [CP] Check Pods Manifest.lock */ = {
279+
710033BFDB2DA5AA5DFE56E0 /* [CP] Check Pods Manifest.lock */ = {
280280
isa = PBXShellScriptBuildPhase;
281281
buildActionMask = 2147483647;
282282
files = (
@@ -346,7 +346,7 @@
346346
/* Begin XCBuildConfiguration section */
347347
13B07F941A680F5B00A75B9A /* Debug */ = {
348348
isa = XCBuildConfiguration;
349-
baseConfigurationReference = CC539E79261FD03377281B08 /* Pods-example.debug.xcconfig */;
349+
baseConfigurationReference = 22AACBBE82D2DDD05C1CABEF /* Pods-example.debug.xcconfig */;
350350
buildSettings = {
351351
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
352352
CODE_SIGN_IDENTITY = "iPhone Developer: 翰林 刘 (LVKR5M7XFD)";
@@ -370,7 +370,7 @@
370370
};
371371
13B07F951A680F5B00A75B9A /* Release */ = {
372372
isa = XCBuildConfiguration;
373-
baseConfigurationReference = 34AADD6936D2106EB77FC30D /* Pods-example.release.xcconfig */;
373+
baseConfigurationReference = B6D6982FDB9C47421B528899 /* Pods-example.release.xcconfig */;
374374
buildSettings = {
375375
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
376376
CODE_SIGN_IDENTITY = "iPhone Developer: 翰林 刘 (LVKR5M7XFD)";

0 commit comments

Comments
 (0)