Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
GMPhobos
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
GMPhobos
Commits
eea2869b
Commit
eea2869b
authored
Jun 24, 2019
by
井庆林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
phobos重构
parent
2e1dbac1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
14 deletions
+12
-14
Phobos.h
GMPhobos/Classes/Phobos.h
+7
-7
Phobos.m
GMPhobos/Classes/Phobos.m
+0
-0
PhobosConfig.h
GMPhobos/Classes/PhobosConfig.h
+2
-1
PhobosUtil.h
GMPhobos/Classes/PhobosUtil.h
+1
-1
PhobosUtil.m
GMPhobos/Classes/PhobosUtil.m
+2
-5
No files found.
GMPhobos/Classes/Phobos.h
View file @
eea2869b
...
@@ -131,12 +131,12 @@ typedef NS_ENUM (NSInteger, PhobosSigningType) {
...
@@ -131,12 +131,12 @@ typedef NS_ENUM (NSInteger, PhobosSigningType) {
*
*
* @since 0.0.1
* @since 0.0.1
*/
*/
+
(
void
)
track
:(
NSString
*
)
event
Id
attributes
:(
NSDictionary
*
)
attributes
;
+
(
void
)
track
:(
NSString
*
)
event
Name
attributes
:(
NSDictionary
*
)
attributes
;
+
(
void
)
track
:(
NSString
*
)
event
Id
attributes
:(
NSDictionary
*
)
attributes
sendNow
:(
BOOL
)
sendNow
;
+
(
void
)
track
:(
NSString
*
)
event
Name
attributes
:(
NSDictionary
*
)
attributes
sendNow
:(
BOOL
)
sendNow
;
+
(
void
)
track
:(
NSString
*
)
event
Id
;
+
(
void
)
track
:(
NSString
*
)
event
Name
;
/**
/**
* @brief 自定义事件,数量统计 7730 精准曝光.
* @brief 自定义事件,数量统计 7730 精准曝光
/数据链路
.
*
*
* @param eventId 事件Id
* @param eventId 事件Id
* @attributes 参数
* @attributes 参数
...
@@ -144,9 +144,9 @@ typedef NS_ENUM (NSInteger, PhobosSigningType) {
...
@@ -144,9 +144,9 @@ typedef NS_ENUM (NSInteger, PhobosSigningType) {
* @currentAPI 当前传过来的API
* @currentAPI 当前传过来的API
* @
* @
*/
*/
+
(
void
)
track
:(
NSString
*
)
event
Id
attributes
:(
NSDictionary
*
)
attributes
currentAPI
:(
NSString
*
)
currentAPI
;
+
(
void
)
track
:(
NSString
*
)
event
Name
attributes
:(
NSDictionary
*
)
attributes
currentAPI
:(
NSString
*
)
currentAPI
;
+
(
void
)
track
:(
NSString
*
)
event
Id
attributes
:(
NSDictionary
*
)
attributes
sendNow
:(
BOOL
)
sendNow
currentAPI
:(
NSString
*
)
currentAPI
;
+
(
void
)
track
:(
NSString
*
)
event
Name
attributes
:(
NSDictionary
*
)
attributes
sendNow
:(
BOOL
)
sendNow
currentAPI
:(
NSString
*
)
currentAPI
;
+
(
void
)
track
:(
NSString
*
)
event
Id
currentAPI
:(
NSString
*
)
currentAPI
;
+
(
void
)
track
:(
NSString
*
)
event
Name
currentAPI
:(
NSString
*
)
currentAPI
;
/**
/**
* @author 翟国钧, 16-02-03 16:02:30
* @author 翟国钧, 16-02-03 16:02:30
...
...
GMPhobos/Classes/Phobos.m
View file @
eea2869b
This diff is collapsed.
Click to expand it.
GMPhobos/Classes/PhobosConfig.h
View file @
eea2869b
...
@@ -18,7 +18,8 @@
...
@@ -18,7 +18,8 @@
#define PhobosHaveOpenApp @"PhobosHaveOpenApp" //是否打开过APP
#define PhobosHaveOpenApp @"PhobosHaveOpenApp" //是否打开过APP
#define PhobosBeginTime @"PhobosBeginTime" //记录APP打开|从后台启动时的时间戳
#define PhobosBeginTime @"PhobosBeginTime" //记录APP打开|从后台启动时的时间戳
#define PhobosEndTime @"PhobosEndTime" //记录APP退出|退到后台时的时间戳
#define PhobosEndTime @"PhobosEndTime" //记录APP退出|退到后台时的时间戳
#define PhobosCacheKey @"PhobosCacheKey" //存放持久化埋点数据的key
#define PhobosNormalCacheKey @"PhobosNormalCacheKey" //存放持久化埋点数据的key
#define PhobosRealTimeCacheKeys @"PhobosRealTimeCacheKey" //存放持久化实时埋点数据的key
#define PhobosTempCacheKey @"PhobosTempCacheKey" //临时存放待发送埋点数据的key
#define PhobosTempCacheKey @"PhobosTempCacheKey" //临时存放待发送埋点数据的key
#define PhobosShardCount 50 //收集数据分段发送的个数
#define PhobosShardCount 50 //收集数据分段发送的个数
...
...
GMPhobos/Classes/PhobosUtil.h
View file @
eea2869b
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
typedef
void
(
^
SendDataSuccessBlock
)(
NSInteger
code
);
typedef
void
(
^
SendDataSuccessBlock
)(
BOOL
success
);
@interface
PhobosUtil
:
NSObject
@interface
PhobosUtil
:
NSObject
...
...
GMPhobos/Classes/PhobosUtil.m
View file @
eea2869b
...
@@ -123,11 +123,8 @@
...
@@ -123,11 +123,8 @@
// sendAsynchronousRequest 在iOS9以后y被废除了
// sendAsynchronousRequest 在iOS9以后y被废除了
NSURLSession
*
session
=
[
NSURLSession
sharedSession
];
NSURLSession
*
session
=
[
NSURLSession
sharedSession
];
NSURLSessionDataTask
*
dataTask
=
[
session
dataTaskWithRequest
:
request
completionHandler
:
^
(
NSData
*
_Nullable
data
,
NSURLResponse
*
_Nullable
response
,
NSError
*
_Nullable
error
)
{
NSURLSessionDataTask
*
dataTask
=
[
session
dataTaskWithRequest
:
request
completionHandler
:
^
(
NSData
*
_Nullable
data
,
NSURLResponse
*
_Nullable
response
,
NSError
*
_Nullable
error
)
{
if
(
!
error
)
{
if
(
success
)
{
//没有错误,返回正确;
success
(
!
error
?
YES
:
NO
);
if
(
success
)
{
success
(
200
);
}
}
}
}];
}];
[
dataTask
resume
];
[
dataTask
resume
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment