Commit bc6a86ac cgx

隐私页面导航栏调整 && Universal Link配置

1 个父辈 51af4980
......@@ -160,7 +160,7 @@
D0E9408427FE96A900D57495 /* WXApiObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXApiObject.h; sourceTree = "<group>"; };
D0E9408627FE96A900D57495 /* WechatAuthSDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WechatAuthSDK.h; sourceTree = "<group>"; };
D0E9408727FE96A900D57495 /* libWeChatSDK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libWeChatSDK.a; sourceTree = "<group>"; };
D0E9409127FED77000D57495 /* DreamSleep.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DreamSleep.entitlements; sourceTree = "<group>"; };
D0F808ED2803C83A0097899F /* DreamSleepDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DreamSleepDebug.entitlements; sourceTree = "<group>"; };
F02C34A5649294F60932630C /* Pods-DreamSleep.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DreamSleep.release.xcconfig"; path = "Target Support Files/Pods-DreamSleep/Pods-DreamSleep.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
......@@ -354,7 +354,7 @@
D0B5ECA327F2D9DE003EDFE3 /* DreamSleep */ = {
isa = PBXGroup;
children = (
D0E9409127FED77000D57495 /* DreamSleep.entitlements */,
D0F808ED2803C83A0097899F /* DreamSleepDebug.entitlements */,
D0E9408127FE961300D57495 /* Vendors */,
D04567AA27F6D067009F0A82 /* Main */,
D04567AB27F6D0A5009F0A82 /* Home */,
......@@ -750,11 +750,11 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
Bundle_Display_Name = "小梦睡眠-Dev";
CODE_SIGN_ENTITLEMENTS = DreamSleep/DreamSleep.entitlements;
CODE_SIGN_ENTITLEMENTS = DreamSleep/DreamSleepDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = SPH85C3TWU;
GCC_PREFIX_HEADER = "${SRCROOT}/DreamSleep/Utils/PrefixHeader.pch";
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
GENERATE_INFOPLIST_FILE = YES;
......@@ -799,8 +799,8 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
Bundle_Display_Name = "小梦睡眠-冥想解压助眠健康养生";
CODE_SIGN_ENTITLEMENTS = DreamSleep/DreamSleep.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 4NDZ6UX8PW;
GCC_PREFIX_HEADER = "${SRCROOT}/DreamSleep/Utils/PrefixHeader.pch";
......@@ -832,7 +832,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.aolei.sleep;
PRODUCT_MODULE_NAME = DreamSleep;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = xiaomengSleep_dis_profile;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = 1;
};
......@@ -905,10 +905,10 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
Bundle_Display_Name = "小梦睡眠-Beta";
CODE_SIGN_ENTITLEMENTS = DreamSleep/DreamSleep.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 4NDZ6UX8PW;
GCC_PREFIX_HEADER = "${SRCROOT}/DreamSleep/Utils/PrefixHeader.pch";
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
GENERATE_INFOPLIST_FILE = YES;
......@@ -938,7 +938,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.aolei.sleep;
PRODUCT_MODULE_NAME = DreamSleepBeta;
PRODUCT_NAME = "$(TARGET_NAME)Beta";
PROVISIONING_PROFILE_SPECIFIER = "";
PROVISIONING_PROFILE_SPECIFIER = xiaomengSleep_adhot_profile;
SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = 1;
};
......
......@@ -112,7 +112,7 @@
_aiWebView.navigationDelegate = self;
_aiWebView.scrollView.showsVerticalScrollIndicator = NO;
_aiWebView.scrollView.showsHorizontalScrollIndicator = NO;
// iOS 11:
// 解决页面顶部出现白色问题
_aiWebView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
// 测试地址:https://www.cbti.cn/sleep/ai/sleep_aicocah
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:https://www.cbti.cn/sleep_apple</string>
</array>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>
......@@ -8,6 +8,7 @@
#import "DsMiddleView.h"
#import "HeaderDataModel.h"
#import "BreatheController.h"
#import "WXApi.h"
@interface DsMiddleView ()
@property (nonatomic, strong) UIButton *unityBtn;
......@@ -77,6 +78,16 @@
[self.ds_viewController.navigationController pushViewController:breatheVC animated:YES];
self.ds_viewController.hidesBottomBarWhenPushed = NO;
}
#pragma mark - 模拟微信登录
// // 构造SendAuthReq结构体
// SendAuthReq* req = [[SendAuthReq alloc] init];
// req.scope = @"snsapi_userinfo";
// req.state = @"123";
// // 第三方向微信终端发送一个SendAuthReq消息结构
// [WXApi sendReq:req completion:^(BOOL success) {
// DSLog(@"调起微信成功...");
// }];
}
@end
......@@ -6,7 +6,6 @@
//
#import "LeadView.h"
#import "WXApi.h"
@interface LeadView () <UIScrollViewDelegate>
@property (nonatomic, strong) UIScrollView *mainScrollView;
......@@ -85,16 +84,6 @@
}
- (void)startAction {
#pragma mark - 模拟微信登录
// // 构造SendAuthReq结构体
// SendAuthReq* req = [[SendAuthReq alloc] init];
// req.scope = @"snsapi_userinfo";
// req.state = @"123";
// // 第三方向微信终端发送一个SendAuthReq消息结构
// [WXApi sendReq:req completion:^(BOOL success) {
// DSLog(@"调起微信成功...");
// }];
if (self.delegate && [self.delegate respondsToSelector:@selector(startExplore)]) {
[self.delegate startExplore];
}
......
......@@ -10,6 +10,7 @@
#import "PrivacyViewController.h"
#import "DSTabBarController.h"
#import "WXApi.h"
#import "BaseNaviController.h"
@interface AppDelegate () <WXApiDelegate>
@end
......@@ -22,9 +23,9 @@
[self.window makeKeyAndVisible];
UIStoryboard * mainStoryBoard =[UIStoryboard storyboardWithName:@"Main" bundle:nil];
self.window.rootViewController = [mainStoryBoard instantiateViewControllerWithIdentifier:@"mainSB"];
// UINavigationController *navi = [[UINavigationController alloc] initWithRootViewController:[[PrivacyViewController alloc] init]];
// self.window.rootViewController = navi;
// BaseNaviController *navi = [[BaseNaviController alloc] initWithRootViewController:[[PrivacyViewController alloc] init]];
// self.window.rootViewController = navi;
[self initWeChat];
......@@ -33,17 +34,17 @@
- (void)initWeChat {
// 在register之前打开log, 后续可以根据log排查问题
// [WXApi startLogByLevel:WXLogLevelDetail logBlock:^(NSString *log) {
// NSLog(@"WeChatSDK: %@", log);
// }];
// [WXApi startLogByLevel:WXLogLevelDetail logBlock:^(NSString *log) {
// DSLog(@"WeChatSDK: %@", log);
// }];
// 务必在调用自检函数前注册
[WXApi registerApp:WeChatAppID universalLink:@"https://help.wechat.com/sdksample/"];
[WXApi registerApp:WeChatAppID universalLink:UNIVERSAL_LINK];
// 调用自检函数
// [WXApi checkUniversalLinkReady:^(WXULCheckStep step, WXCheckULStepResult* result) {
// NSLog(@"%@, %u, %@, %@", @(step), result.success, result.errorInfo, result.suggestion);
// }];
// [WXApi checkUniversalLinkReady:^(WXULCheckStep step, WXCheckULStepResult* result) {
// DSLog(@"%@, %u, %@, %@", @(step), result.success, result.errorInfo, result.suggestion);
// }];
}
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options {
......@@ -55,8 +56,34 @@
DSLog(@"req:%@", req);
}
- (void)onResp:(BaseResp *)resp {
DSLog(@"resp:%@", resp);
/*! 微信回调,不管是登录还是分享成功与否,都是走这个方法 @brief 发送一个sendReq后,收到微信的回应
*
* 收到一个来自微信的处理结果。调用一次sendReq后会收到onResp。
* 可能收到的处理结果有SendMessageToWXResp、SendAuthResp等。
* @param resp 具体的回应内容,是自动释放的
*/
- (void)onResp:(BaseResp*)resp {
DSLog(@"resp %d",resp.errCode);
/*
enum WXErrCode {
WXSuccess = 0, 成功
WXErrCodeCommon = -1, 普通错误类型
WXErrCodeUserCancel = -2, 用户点击取消并返回
WXErrCodeSentFail = -3, 发送失败
WXErrCodeAuthDeny = -4, 授权失败
WXErrCodeUnsupport = -5, 微信不支持
};
*/
// 授权登录的类
if ([resp isKindOfClass:[SendAuthResp class]]) {
if (resp.errCode == 0) {
SendAuthResp *resp2 = (SendAuthResp *)resp;
DSLog(@"resp2.code:%@", resp2.code);
} else {
DSLog(@"error:%@", resp.errStr);
}
}
}
@end
......@@ -21,11 +21,14 @@
+ (void)setNavigationBarStyle:(NaviStyle)style vc:(UIViewController *)vc {
UINavigationBar *naviBar = vc.navigationController.navigationBar;
UIColor *titleColor = ColorFromHex(0x333333);
UIColor *bgColor = DSWhite;
UIColor *barTintColor = DSWhite;
// NaviStyleDefault
UIColor *titleColor = DSWhite;
UIColor *bgColor = BrandColor;
UIColor *barTintColor = BrandColor;
if (style == NaviStyleLight) {
titleColor = ColorFromHex(0x333333);
bgColor = DSWhite;
barTintColor = DSWhite;
} else if (style == NaviStyleDark) {
titleColor = DSWhite;
bgColor = DarkColor;
......@@ -44,7 +47,8 @@
appearance.shadowColor = DSClearColor;
// 生效
naviBar.scrollEdgeAppearance = appearance;
// naviBar.standardAppearance = appearance;
// 滚动视图滚动后导航栏背景色不会被影响
naviBar.standardAppearance = appearance;
} else {
// 导航栏title颜色
[naviBar setTitleTextAttributes:titleTextAttributes];
......
......@@ -33,7 +33,6 @@
[super viewDidLoad];
self.view.backgroundColor = DSWhite;
[self naviSetting];
if (self.isDetail) {
self.title = self.naviTitle;
......@@ -49,29 +48,6 @@
self.navigationController.navigationBarHidden = !self.isDetail;
}
- (void)naviSetting {
// 设置导航栏返回按钮文字
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc]
initWithTitle:@""
style:UIBarButtonItemStylePlain
target:self
action:nil];
// 设置导航栏返回按钮颜色
self.navigationController.navigationBar.tintColor = DSWhite;
// 设置导航栏背景色和title颜色
NSDictionary *titleTextAttributes = @{NSForegroundColorAttributeName:DSWhite};
if (@available(iOS 13.0, *)) {
UINavigationBarAppearance *appearance = [UINavigationBarAppearance new];
appearance.titleTextAttributes = titleTextAttributes;
appearance.backgroundColor = BrandColor;
self.navigationController.navigationBar.standardAppearance = appearance;
self.navigationController.navigationBar.scrollEdgeAppearance = appearance;
} else {
self.navigationController.navigationBar.barTintColor = BrandColor;
[self.navigationController.navigationBar setTitleTextAttributes:titleTextAttributes];
}
}
- (void)showPrivacyView {
self.policyView = [[PrivacyView alloc] init];
[self.view addSubview:self.policyView];
......@@ -92,7 +68,7 @@
- (WKWebView *)webView {
if (!_webView) {
_webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, kTopHeight(0), kScreenWidth, kScreenHeight - kTopHeight(0))];
_webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTopHeight(0))];
_webView.backgroundColor = DSWhite;
_webView.scrollView.showsVerticalScrollIndicator = NO;
_webView.scrollView.showsHorizontalScrollIndicator = NO;
......
......@@ -13,7 +13,7 @@ NSString * const PrivacyStatement = @"欢迎来到小梦睡眠,我们依据最
NSString * const WeChatAppID = @"wx4cdd4760092cdfdf";
NSString * const WeChatAppSecret = @"";
NSString * const UNIVERSAL_LINK = @"";
NSString * const UNIVERSAL_LINK = @"https://www.cbti.cn/sleep_apple/";
@implementation DSConstUtil
@end
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!