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
9caff025
Commit
9caff025
authored
Dec 10, 2018
by
朱璇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 精准曝光不删除缓存数据
parent
bb2ea48b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
Phobos.m
GMPhobos/Classes/Phobos.m
+5
-5
PhobosConfig.h
GMPhobos/Classes/PhobosConfig.h
+2
-0
No files found.
GMPhobos/Classes/Phobos.m
View file @
9caff025
...
@@ -480,7 +480,7 @@ static NSString *sdkVersion = @"110";
...
@@ -480,7 +480,7 @@ static NSString *sdkVersion = @"110";
从缓存区获取数据,发给服务器,请求成功的时候,把缓存区的数据删除掉
从缓存区获取数据,发给服务器,请求成功的时候,把缓存区的数据删除掉
*/
*/
-
(
void
)
sendArrayWithCurrentAPI
:
(
NSString
*
)
currentAPI
{
-
(
void
)
sendArrayWithCurrentAPI
:
(
NSString
*
)
currentAPI
{
NSMutableArray
*
dataArray
=
[
GMCache
fetchObjectAtDocumentPathWithkey
:
PhobosTempCacheKey
];
NSMutableArray
*
dataArray
=
[
GMCache
fetchObjectAtDocumentPathWithkey
:
Phobos
Expusure
TempCacheKey
];
if
(
_logEnabled
)
{
if
(
_logEnabled
)
{
NSData
*
data
=
[
NSJSONSerialization
dataWithJSONObject
:
dataArray
options
:
NSJSONWritingPrettyPrinted
error
:
nil
];
NSData
*
data
=
[
NSJSONSerialization
dataWithJSONObject
:
dataArray
options
:
NSJSONWritingPrettyPrinted
error
:
nil
];
NSString
*
jsonString
=
[[
NSString
alloc
]
initWithData
:
data
encoding
:
NSUTF8StringEncoding
];
NSString
*
jsonString
=
[[
NSString
alloc
]
initWithData
:
data
encoding
:
NSUTF8StringEncoding
];
...
@@ -492,7 +492,7 @@ static NSString *sdkVersion = @"110";
...
@@ -492,7 +492,7 @@ static NSString *sdkVersion = @"110";
if
(
compressedData
)
{
if
(
compressedData
)
{
[
PhobosUtil
sendData
:
compressedData
currentAPI
:
currentAPI
success
:^
(
NSInteger
code
)
{
[
PhobosUtil
sendData
:
compressedData
currentAPI
:
currentAPI
success
:^
(
NSInteger
code
)
{
phobosLog
(
@"✈ ---------- ✈ data arrived Mars"
);
phobosLog
(
@"✈ ---------- ✈ data arrived Mars"
);
[
GMCache
removeObjectAtDocumentPathWithkey
:
PhobosTempCacheKey
];
[
GMCache
removeObjectAtDocumentPathWithkey
:
Phobos
Expusure
TempCacheKey
];
}];
}];
}
}
}
}
...
@@ -535,17 +535,17 @@ static NSString *sdkVersion = @"110";
...
@@ -535,17 +535,17 @@ static NSString *sdkVersion = @"110";
@try
{
@try
{
//1.获取缓存区的数据,把新数据追加进去
//1.获取缓存区的数据,把新数据追加进去
NSMutableArray
*
dataArray
=
[
GMCache
fetchObjectAtDocumentPathWithkey
:
PhobosTempCacheKey
];
NSMutableArray
*
dataArray
=
[
GMCache
fetchObjectAtDocumentPathWithkey
:
Phobos
Expusure
TempCacheKey
];
if
(
dataArray
)
{
if
(
dataArray
)
{
[
dataArray
addObjectsFromArray
:
array
];
[
dataArray
addObjectsFromArray
:
array
];
}
else
{
}
else
{
dataArray
=
[
NSMutableArray
arrayWithArray
:
array
];
dataArray
=
[
NSMutableArray
arrayWithArray
:
array
];
}
}
[
GMCache
storeObjectAtDocumentPathWithkey
:
PhobosTempCacheKey
object
:
dataArray
];
[
GMCache
storeObjectAtDocumentPathWithkey
:
Phobos
Expusure
TempCacheKey
object
:
dataArray
];
//2.把缓存区的数据发送给服务器
//2.把缓存区的数据发送给服务器
[
self
sendArrayWithCurrentAPI
:
currentAPI
];
[
self
sendArrayWithCurrentAPI
:
currentAPI
];
//3.把原有的数据删除
//3.把原有的数据删除
[
GMCache
removeObjectAtDocumentPathWithkey
:
PhobosCacheKey
];
//
[GMCache removeObjectAtDocumentPathWithkey:PhobosCacheKey];
}
}
@catch
(
NSException
*
exception
)
{
@catch
(
NSException
*
exception
)
{
phobosLog
(
exception
);
phobosLog
(
exception
);
...
...
GMPhobos/Classes/PhobosConfig.h
View file @
9caff025
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
#define PhobosEndTime @"PhobosEndTime" //记录APP退出|退到后台时的时间戳
#define PhobosEndTime @"PhobosEndTime" //记录APP退出|退到后台时的时间戳
#define PhobosCacheKey @"PhobosCacheKey" //存放持久化埋点数据的key
#define PhobosCacheKey @"PhobosCacheKey" //存放持久化埋点数据的key
#define PhobosTempCacheKey @"PhobosTempCacheKey" //临时存放待发送埋点数据的key
#define PhobosTempCacheKey @"PhobosTempCacheKey" //临时存放待发送埋点数据的key
#define PhobosExpusureTempCacheKey @"PhobosExpusureTempCacheKey" //临时存放待发送埋点数据的key(精准曝光)
#define PhobosShardCount 50 //收集数据分段发送的个数
#define PhobosShardCount 50 //收集数据分段发送的个数
#endif
/* PhobosConfig_h */
#endif
/* PhobosConfig_h */
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