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