处理上架的问题
1:处理了openurl 拉起问题 2:去掉了http 3 隐私等等
This commit is contained in:
@@ -201,8 +201,19 @@ static void KBMaiPoint_DebugLogError(NSURLResponse *response, NSError *error) {
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *base = [self kb_trimmedStringOrEmpty:KB_MAI_POINT_BASE_URL];
|
||||
if (base.length == 0) {
|
||||
// Release 默认关闭:避免上架包携带内网/HTTP 域名。
|
||||
if (completion) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
completion(YES, nil);
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *safePath = [path hasPrefix:@"/"] ? path : [@"/" stringByAppendingString:path];
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@%@", KB_MAI_POINT_BASE_URL, safePath];
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@%@", base, safePath];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
if (!url) {
|
||||
NSError *error = [NSError errorWithDomain:KBMaiPointErrorDomain
|
||||
@@ -216,6 +227,18 @@ static void KBMaiPoint_DebugLogError(NSURLResponse *response, NSError *error) {
|
||||
return;
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
// 上架版本只允许 HTTPS,上报地址若为 HTTP 则视为关闭。
|
||||
if (![url.scheme.lowercaseString isEqualToString:@"https"]) {
|
||||
if (completion) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
completion(YES, nil);
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
NSError *jsonError = nil;
|
||||
NSData *body = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:&jsonError];
|
||||
if (jsonError) {
|
||||
|
||||
Reference in New Issue
Block a user