友盟统计
This commit is contained in:
3
Podfile
3
Podfile
@@ -50,6 +50,9 @@ target 'xplan-ios' do
|
|||||||
pod 'SVGAPlayer', '~> 2.3'
|
pod 'SVGAPlayer', '~> 2.3'
|
||||||
# 滑动标签栏
|
# 滑动标签栏
|
||||||
pod 'JXCategoryView'
|
pod 'JXCategoryView'
|
||||||
|
#UM统计
|
||||||
|
pod 'UMCommon'
|
||||||
|
pod 'UMDevice'
|
||||||
#调试
|
#调试
|
||||||
pod 'LookinServer', :configurations => ['Debug']
|
pod 'LookinServer', :configurations => ['Debug']
|
||||||
|
|
||||||
|
11
Podfile.lock
11
Podfile.lock
@@ -68,6 +68,9 @@ PODS:
|
|||||||
- SVGAPlayer/ProtoFiles (2.5.7):
|
- SVGAPlayer/ProtoFiles (2.5.7):
|
||||||
- Protobuf (~> 3.4)
|
- Protobuf (~> 3.4)
|
||||||
- SZTextView (1.3.0)
|
- SZTextView (1.3.0)
|
||||||
|
- UMCommon (7.3.5):
|
||||||
|
- UMDevice
|
||||||
|
- UMDevice (2.0.5)
|
||||||
- YYText (1.0.7)
|
- YYText (1.0.7)
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
@@ -99,6 +102,8 @@ DEPENDENCIES:
|
|||||||
- SSKeychain
|
- SSKeychain
|
||||||
- SVGAPlayer (~> 2.3)
|
- SVGAPlayer (~> 2.3)
|
||||||
- SZTextView
|
- SZTextView
|
||||||
|
- UMCommon
|
||||||
|
- UMDevice
|
||||||
- YYText
|
- YYText
|
||||||
|
|
||||||
SPEC REPOS:
|
SPEC REPOS:
|
||||||
@@ -131,6 +136,8 @@ SPEC REPOS:
|
|||||||
- SSZipArchive
|
- SSZipArchive
|
||||||
- SVGAPlayer
|
- SVGAPlayer
|
||||||
- SZTextView
|
- SZTextView
|
||||||
|
- UMCommon
|
||||||
|
- UMDevice
|
||||||
- YYText
|
- YYText
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
@@ -162,8 +169,10 @@ SPEC CHECKSUMS:
|
|||||||
SSZipArchive: e7b4f3d9e780c2acc1764cd88fbf2de28f26e5b2
|
SSZipArchive: e7b4f3d9e780c2acc1764cd88fbf2de28f26e5b2
|
||||||
SVGAPlayer: 318b85a78b61292d6ae9dfcd651f3f0d1cdadd86
|
SVGAPlayer: 318b85a78b61292d6ae9dfcd651f3f0d1cdadd86
|
||||||
SZTextView: 094dc6acc9beec537685c545d6e3e0d4975174e1
|
SZTextView: 094dc6acc9beec537685c545d6e3e0d4975174e1
|
||||||
|
UMCommon: ab4d875ddefe1b06c60b577e4a58bc4d433ee067
|
||||||
|
UMDevice: c13bbb2e8ca6c67d1e23e03162553e3ec5a8b5b0
|
||||||
YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
|
YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
|
||||||
|
|
||||||
PODFILE CHECKSUM: f92e790f8e5a7fe6d90dc59b233bbb18e072f4c7
|
PODFILE CHECKSUM: 5784f27468bf1fc975791ded5ab665168b6d1611
|
||||||
|
|
||||||
COCOAPODS: 1.10.1
|
COCOAPODS: 1.10.1
|
||||||
|
@@ -9,10 +9,13 @@
|
|||||||
///Third
|
///Third
|
||||||
#import <ShareSDK/ShareSDK.h>
|
#import <ShareSDK/ShareSDK.h>
|
||||||
#import <NIMSDK/NIMSDK.h>
|
#import <NIMSDK/NIMSDK.h>
|
||||||
|
#import <UMCommon/UMCommon.h>
|
||||||
///Tool
|
///Tool
|
||||||
#import "XPConstant.h"
|
#import "XPConstant.h"
|
||||||
#import "CustomAttachmentDecoder.h"
|
#import "CustomAttachmentDecoder.h"
|
||||||
|
|
||||||
|
UIKIT_EXTERN NSString * kYinyouPrivateKey;
|
||||||
|
|
||||||
@implementation AppDelegate (ThirdConfig)
|
@implementation AppDelegate (ThirdConfig)
|
||||||
|
|
||||||
|
|
||||||
@@ -20,6 +23,7 @@
|
|||||||
- (void)initThirdConfig {
|
- (void)initThirdConfig {
|
||||||
[self configShareSDK];
|
[self configShareSDK];
|
||||||
[self configNIMSDK];
|
[self configNIMSDK];
|
||||||
|
[self configUMengSDK];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)configShareSDK {
|
- (void)configShareSDK {
|
||||||
@@ -48,4 +52,12 @@
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - 友盟SDK
|
||||||
|
- (void)configUMengSDK {
|
||||||
|
// 只有同意过了隐私协议 才初始化
|
||||||
|
if ([[NSUserDefaults standardUserDefaults] objectForKey:kYinyouPrivateKey]) {
|
||||||
|
[UMConfigure initWithAppkey:KeyWithType(keyType_UMengAppKey) channel:KeyWithType(keyType_UMengAppChannel)];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -11,13 +11,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
@interface XPConstant : NSObject
|
@interface XPConstant : NSObject
|
||||||
|
|
||||||
UIKIT_EXTERN NSString * const kUMengAppkey;
|
|
||||||
UIKIT_EXTERN NSString * const kChannelKey;
|
|
||||||
UIKIT_EXTERN NSString * const kWeChatNumber;
|
UIKIT_EXTERN NSString * const kWeChatNumber;
|
||||||
|
|
||||||
typedef NS_ENUM(NSUInteger, KeyType) {
|
typedef NS_ENUM(NSUInteger, KeyType) {
|
||||||
KeyType_PasswordEncode,///密码 des 加密的
|
KeyType_PasswordEncode,///密码 des 加密的
|
||||||
KeyType_NTESQuickLoginBusinessId,///玩意易盾 快捷登录 id
|
KeyType_NTESQuickLoginBusinessId,///网易易盾 快捷登录 id
|
||||||
KeyType_QQAppid,///qq appid
|
KeyType_QQAppid,///qq appid
|
||||||
KeyType_QQSecret, ///QQ 的 secret
|
KeyType_QQSecret, ///QQ 的 secret
|
||||||
KeyType_WechatAppid,///微信的 appid
|
KeyType_WechatAppid,///微信的 appid
|
||||||
@@ -26,6 +24,8 @@ typedef NS_ENUM(NSUInteger, KeyType) {
|
|||||||
KeyType_NetEase,///云信的key
|
KeyType_NetEase,///云信的key
|
||||||
KeyType_APNSCer,///推送证书的名字
|
KeyType_APNSCer,///推送证书的名字
|
||||||
keyType_YiDunBussinessId,///易盾的id
|
keyType_YiDunBussinessId,///易盾的id
|
||||||
|
keyType_UMengAppKey,///友盟统计的key
|
||||||
|
keyType_UMengAppChannel,///友盟统计的渠道
|
||||||
};
|
};
|
||||||
|
|
||||||
/// 获取当前项目中所用到的 type 所对应的 value 的值 type 类型
|
/// 获取当前项目中所用到的 type 所对应的 value 的值 type 类型
|
||||||
|
@@ -9,8 +9,6 @@
|
|||||||
|
|
||||||
@implementation XPConstant
|
@implementation XPConstant
|
||||||
|
|
||||||
NSString * const kUMengAppKey = @"5ff6bc6dadb42d5826a1cbc4";
|
|
||||||
NSString * const kChannelKey = @"App Store";
|
|
||||||
NSString * const kWeChatNumber = @"yinyoucc";
|
NSString * const kWeChatNumber = @"yinyoucc";
|
||||||
|
|
||||||
///在里面进行判断当前环境是什么
|
///在里面进行判断当前环境是什么
|
||||||
@@ -35,6 +33,8 @@ NSString * const KeyWithType(KeyType type) {
|
|||||||
@(KeyType_NetEase) : @"14ef7a0d0a84cb49bae1c22d78cf1ddf",
|
@(KeyType_NetEase) : @"14ef7a0d0a84cb49bae1c22d78cf1ddf",
|
||||||
@(KeyType_APNSCer) : @"yinyouApnsRelease",
|
@(KeyType_APNSCer) : @"yinyouApnsRelease",
|
||||||
@(keyType_YiDunBussinessId) : @"2eda1894214da27d5ab7aec146fed2a2",
|
@(keyType_YiDunBussinessId) : @"2eda1894214da27d5ab7aec146fed2a2",
|
||||||
|
@(keyType_UMengAppKey) : @"5ff6bc6dadb42d5826a1cbc4",
|
||||||
|
@(keyType_UMengAppChannel) : @"App Store",
|
||||||
},
|
},
|
||||||
///测试环境
|
///测试环境
|
||||||
@(NO):@{
|
@(NO):@{
|
||||||
@@ -48,6 +48,8 @@ NSString * const KeyWithType(KeyType type) {
|
|||||||
@(KeyType_NetEase) : @"82a8d602aacbbb27a1c0fc809052286e",
|
@(KeyType_NetEase) : @"82a8d602aacbbb27a1c0fc809052286e",
|
||||||
@(KeyType_APNSCer) : @"yinyouApnsDebug",
|
@(KeyType_APNSCer) : @"yinyouApnsDebug",
|
||||||
@(keyType_YiDunBussinessId) : @"7ed4c5f72673dfc2d813a27bd5854874",
|
@(keyType_YiDunBussinessId) : @"7ed4c5f72673dfc2d813a27bd5854874",
|
||||||
|
@(keyType_UMengAppKey) : @"5ff6bc6dadb42d5826a1cbc4",
|
||||||
|
@(keyType_UMengAppChannel) : @"App Store",
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
NSDictionary * enviroDic = [dic objectForKey:@(isRelase)];
|
NSDictionary * enviroDic = [dic objectForKey:@(isRelase)];
|
||||||
|
@@ -10,7 +10,9 @@
|
|||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
#import <YYText/YYText.h>
|
#import <YYText/YYText.h>
|
||||||
#import <AppTrackingTransparency/AppTrackingTransparency.h>
|
#import <AppTrackingTransparency/AppTrackingTransparency.h>
|
||||||
|
#import <UMCommon/UMCommon.h>
|
||||||
///Tool
|
///Tool
|
||||||
|
#import "XPConstant.h"
|
||||||
#import "ThemeColor.h"
|
#import "ThemeColor.h"
|
||||||
#import "XPMacro.h"
|
#import "XPMacro.h"
|
||||||
#import "XPHtmlUrl.h"
|
#import "XPHtmlUrl.h"
|
||||||
@@ -21,12 +23,16 @@
|
|||||||
|
|
||||||
NSString * const kYinyouPrivateKey = @"kYinyouPrivateKey";
|
NSString * const kYinyouPrivateKey = @"kYinyouPrivateKey";
|
||||||
@interface UserPrivacyView ()
|
@interface UserPrivacyView ()
|
||||||
/** title */
|
///title
|
||||||
@property (nonatomic, strong) UILabel *titleLabel;
|
@property (nonatomic, strong) UILabel *titleLabel;
|
||||||
/** contentLabel */
|
///内容
|
||||||
@property (nonatomic, strong) YYTextView *contentLabel;
|
@property (nonatomic, strong) YYTextView *contentLabel;
|
||||||
/** confirmButton */
|
///容器
|
||||||
|
@property (nonatomic,strong) UIStackView *stackView;
|
||||||
|
///确认
|
||||||
@property (nonatomic, strong) UIButton *confirmButton;
|
@property (nonatomic, strong) UIButton *confirmButton;
|
||||||
|
///退出
|
||||||
|
@property (nonatomic, strong) UIButton *exitButton;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation UserPrivacyView
|
@implementation UserPrivacyView
|
||||||
@@ -48,10 +54,15 @@ NSString * const kYinyouPrivateKey = @"kYinyouPrivateKey";
|
|||||||
[defaults setObject:@"isShow" forKey:kYinyouPrivateKey];
|
[defaults setObject:@"isShow" forKey:kYinyouPrivateKey];
|
||||||
[defaults synchronize];
|
[defaults synchronize];
|
||||||
[self getAdvertisingTrackingAuthority];//请求idfa权限
|
[self getAdvertisingTrackingAuthority];//请求idfa权限
|
||||||
|
///初始化友盟
|
||||||
|
[UMConfigure initWithAppkey:KeyWithType(keyType_UMengAppKey) channel:KeyWithType(keyType_UMengAppChannel)];
|
||||||
[TTPopup dismiss];
|
[TTPopup dismiss];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)exitButtonClick:(UIButton *)sender {
|
||||||
|
[self exitApplication];
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Private Method
|
#pragma mark - Private Method
|
||||||
- (void)initSubViews {
|
- (void)initSubViews {
|
||||||
@@ -60,7 +71,9 @@ NSString * const kYinyouPrivateKey = @"kYinyouPrivateKey";
|
|||||||
self.layer.cornerRadius = 10;
|
self.layer.cornerRadius = 10;
|
||||||
[self addSubview:self.titleLabel];
|
[self addSubview:self.titleLabel];
|
||||||
[self addSubview:self.contentLabel];
|
[self addSubview:self.contentLabel];
|
||||||
[self addSubview:self.confirmButton];
|
[self addSubview:self.stackView];
|
||||||
|
[self.stackView addArrangedSubview:self.exitButton];
|
||||||
|
[self.stackView addArrangedSubview:self.confirmButton];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)initSubViewConstraints {
|
- (void)initSubViewConstraints {
|
||||||
@@ -81,12 +94,12 @@ NSString * const kYinyouPrivateKey = @"kYinyouPrivateKey";
|
|||||||
make.bottom.mas_equalTo(-68);
|
make.bottom.mas_equalTo(-68);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[self.confirmButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.bottom.mas_equalTo(-20);
|
make.bottom.mas_equalTo(-20);
|
||||||
make.centerX.mas_equalTo(0);
|
make.left.right.mas_equalTo(self).inset(15);
|
||||||
make.height.mas_equalTo(36);
|
make.height.mas_equalTo(36);
|
||||||
make.width.mas_equalTo(160);
|
|
||||||
}];
|
}];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)getAdvertisingTrackingAuthority {
|
- (void)getAdvertisingTrackingAuthority {
|
||||||
@@ -113,6 +126,22 @@ NSString * const kYinyouPrivateKey = @"kYinyouPrivateKey";
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///退出app
|
||||||
|
- (void)exitApplication {
|
||||||
|
[TTPopup dismiss];
|
||||||
|
[UIView beginAnimations:@"exitApplication" context:nil];
|
||||||
|
[UIView setAnimationDuration:0.5];
|
||||||
|
[UIView setAnimationDelegate:self];
|
||||||
|
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self cache:NO];
|
||||||
|
[UIView setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];
|
||||||
|
[UIView commitAnimations];
|
||||||
|
}
|
||||||
|
- (void)animationFinished:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
|
||||||
|
if ([animationID compare:@"exitApplication"] == 0) {
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - getters and setters
|
#pragma mark - getters and setters
|
||||||
|
|
||||||
- (UILabel *)titleLabel {
|
- (UILabel *)titleLabel {
|
||||||
@@ -163,6 +192,7 @@ NSString * const kYinyouPrivateKey = @"kYinyouPrivateKey";
|
|||||||
}
|
}
|
||||||
return _contentLabel;
|
return _contentLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (UIButton *)confirmButton {
|
- (UIButton *)confirmButton {
|
||||||
if (!_confirmButton) {
|
if (!_confirmButton) {
|
||||||
_confirmButton = [[UIButton alloc]init];
|
_confirmButton = [[UIButton alloc]init];
|
||||||
@@ -178,6 +208,32 @@ NSString * const kYinyouPrivateKey = @"kYinyouPrivateKey";
|
|||||||
return _confirmButton;
|
return _confirmButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (UIButton *)exitButton {
|
||||||
|
if (!_exitButton) {
|
||||||
|
_exitButton = [[UIButton alloc]init];
|
||||||
|
[_exitButton setTitle:@"不同意并退出" forState:UIControlStateNormal];
|
||||||
|
_exitButton.titleLabel.font = [UIFont systemFontOfSize:15];
|
||||||
|
[_exitButton setTitleColor:[ThemeColor cancelButtonTextColor] forState:UIControlStateNormal];
|
||||||
|
UIImage *image = [UIImage gradientColorImageFromColors:@[[ThemeColor cancelButtonGradientStartColor],[ThemeColor cancelButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
|
||||||
|
[_exitButton setBackgroundImage:image forState:UIControlStateNormal];
|
||||||
|
_exitButton.layer.cornerRadius = 18;
|
||||||
|
_exitButton.layer.masksToBounds = YES;
|
||||||
|
[_exitButton addTarget:self action:@selector(exitButtonClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
}
|
||||||
|
return _exitButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UIStackView *)stackView {
|
||||||
|
if (!_stackView) {
|
||||||
|
_stackView = [[UIStackView alloc] init];
|
||||||
|
_stackView.axis = UILayoutConstraintAxisHorizontal;
|
||||||
|
_stackView.distribution = UIStackViewDistributionFillEqually;
|
||||||
|
_stackView.alignment = UIStackViewAlignmentFill;
|
||||||
|
_stackView.spacing = 20;
|
||||||
|
}
|
||||||
|
return _stackView;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -368,7 +368,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) {
|
|||||||
|
|
||||||
CMModel.privacyColor = [ThemeColor mainTextColor];
|
CMModel.privacyColor = [ThemeColor mainTextColor];
|
||||||
CMModel.appPrivacyText = @"登录即代表同意《默认》,并授权音游获取本机号码。";
|
CMModel.appPrivacyText = @"登录即代表同意《默认》,并授权音游获取本机号码。";
|
||||||
CMModel.privacyState = YES;
|
CMModel.privacyState = NO;
|
||||||
CMModel.privacyFont = [UIFont systemFontOfSize:12];
|
CMModel.privacyFont = [UIFont systemFontOfSize:12];
|
||||||
CMModel.protocolColor = [ThemeColor appMainColor];
|
CMModel.protocolColor = [ThemeColor appMainColor];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user