add 友盟统计

This commit is contained in:
lianxiang
2018-08-27 17:09:56 +08:00
parent 6e090fd28d
commit 6a8d55457a
54 changed files with 2560 additions and 1314 deletions
+1 -1
View File
@@ -8,8 +8,8 @@
#import "AppDelegate.h"
#import <UserNotifications/UserNotifications.h>
@interface AppDelegate (GiGaConfig)<UNUserNotificationCenterDelegate>
@interface AppDelegate (GiGaConfig)<UNUserNotificationCenterDelegate>
/**
v1.0 后使用
-4
View File
@@ -70,16 +70,12 @@
item2.image = [[UIImage imageNamed:@""] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}
-(void)configEnvironment{
[GiGaServerConfig setServerType:GIGA_ENVIRONMENT];
}
- (void)setupRootVC{
GiGaMaskTaskViewController *maskeVC = [[GiGaMaskTaskViewController alloc] init];
+13
View File
@@ -9,6 +9,10 @@
#import "AppDelegate+ThirdParty.h"
#define PUSH_APPKEY @"1f8122badd24c2adb8b3f231"
#import "WXApi.h"
#import <Bugly/Bugly.h>
#import <UMCommon/UMCommon.h>
#import <UMAnalytics/MobClick.h>
#define UMAPP_Key @"5b83a929b27b0a1b9e000036"
@implementation AppDelegate (ThirdParty)
@@ -39,6 +43,15 @@
//微信
[WXApi registerApp:WXin_APPID];
//bugly
[Bugly startWithAppId:nil];
//友盟统计
[UMConfigure setEncryptEnabled:YES];
[UMConfigure setLogEnabled:YES];
[UMConfigure initWithAppkey:UMAPP_Key channel:nil];
// NSString* deviceID = [UMConfigure deviceIDForIntegration];
// NSLog(@"集成测试的deviceID:%@",deviceID);
}
+1 -16
View File
@@ -28,14 +28,10 @@
//[NSThread sleepForTimeInterval:1];//延迟启动
_isMasking = NO;
[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
[self registLocalNotification];
[self configThridPartyWithOptions:launchOptions];
[self configEnvironment];
[self setupRootVC];
//广告页
[self creatAdView];
@@ -44,23 +40,16 @@
}
- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
// 当 开启面膜时间 长期保持后台模式
// 当 开启面膜时间 app长期保持后台模式
if (_isMasking) {
[self creatBackGoundTask];
}
//[self creatBackGoundTask];
}
@@ -93,8 +82,6 @@
- (void)applicationWillEnterForeground:(UIApplication *)application {
application.applicationIconBadgeNumber = 0;
[JPUSHService resetBadge];
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
@@ -105,7 +92,6 @@
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
//app 挂起 面膜时间未结束 将发送本地通知提醒
if (_isMasking) {
// [[GiGaLocalNotificationManager localNotifiationCenter] sendLocalNotification:@"闹钟提醒!" fireTimeInterval:2 alertAction:@"面膜时间已添加闹钟提醒!" withIdentifier:kLOCALNotifiID_APPTERMINAL];
@@ -117,7 +103,6 @@
{
if (event.type == UIEventTypeRemoteControl ) {
}
}
+15
View File
@@ -0,0 +1,15 @@
//
// MobClickList.h
// GIGA
//
// Created by lianxiang on 2018/8/27.
// Copyright © 2018年 com.giga.ios. All rights reserved.
//
#ifndef MobClickList_h
#define MobClickList_h
//友盟统计埋点事件
#define MobClick_UserLogin @"userlogin"
#define MobClick_MaskTest @"maskTest"
#endif /* MobClickList_h */
+3
View File
@@ -16,6 +16,9 @@
#import "UIView+Toast.h"
#import "JXTAlertManagerHeader.h"
#import "Masonry.h"
#import <UMCommon/UMCommon.h>
#import <UMAnalytics/MobClick.h>
#import "MobClickList.h"
#ifdef DEBUG
#define GILog(fmt,...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
+2
View File
@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuglyAppIDString</key>
<string>8f49773330</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixin</string>
@@ -42,18 +42,15 @@
//链接正常状态文本属性NSTextCheckingTypeLink;
NSString *text = @"已阅读并同意《用户服务协议》";
[self.useragreementLabel setText:text afterInheritingLabelAttributesAndConfiguringWithBlock:^NSMutableAttributedString *(NSMutableAttributedString *mutableAttributedString) {
NSRange fontRange = [[mutableAttributedString string] rangeOfString:@"用户服务协议" options:NSCaseInsensitiveSearch];
UIFont* sysFont = [UIFont systemFontOfSize:15];
CTFontRef font = CTFontCreateWithName((__bridge CFStringRef)sysFont.fontName, sysFont.pointSize, NULL);
if (font) {
[mutableAttributedString addAttribute:(NSString *)kCTFontAttributeName value:(__bridge id)font range:fontRange];
[mutableAttributedString addAttribute:(NSString *)kCTForegroundColorAttributeName value:(__bridge id)[[UIColor greenColor] CGColor] range:fontRange];
}
return mutableAttributedString;
}];
@@ -89,14 +86,4 @@
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -89,10 +89,10 @@
self.weiXinLoginBtn.layer.cornerRadius = self.weiXinLoginBtn.frame.size.height / 2;
}
-(void)rightBtnAction{
[self dismissViewControllerAnimated:YES completion:nil];
}
-(void)viewWillAppear:(BOOL)animated{
@@ -111,7 +111,6 @@
PassWordResetVC *passVC= [[PassWordResetVC alloc] init];
[self.navigationController pushViewController:passVC animated:YES];
}
#pragma mark - 去注册
@@ -120,11 +119,12 @@
GiGaRegistViewController *registVC = [[GiGaRegistViewController alloc] init];
[self.navigationController pushViewController:registVC animated:YES];
}
#pragma mark - 登录
-(void)loginBtnAction:(UIButton *)btn{
//埋点
[MobClick endEvent:MobClick_UserLogin];
[GiGaUserDefault saveUserId:@"123"];
[self dismissViewControllerAnimated:YES completion:nil];
}
@@ -138,7 +138,6 @@
req.scope = @"snsapi_userinfo";
req.state = @"wx_oauth2_authorization_state";
[WXApi sendReq:req];
}
}
@@ -161,7 +160,6 @@
GILog(@"access_token err-->%@",err.localizedDescription);
}];
}
//获取微信用户信息
@@ -181,6 +179,7 @@
GILog(@"weixin_userinfoApi err-->%@",err.localizedDescription);
}];
}
@end