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
7f64f01d
Commit
7f64f01d
authored
Nov 10, 2017
by
翟国钧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改PhobosHaveOpenApp同步的问题
parent
86351398
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
Phobos.m
Pod/Classes/Phobos.m
+15
-2
No files found.
Pod/Classes/Phobos.m
View file @
7f64f01d
...
...
@@ -58,12 +58,25 @@ static NSString *sdkVersion = @"110";
_appVersion
=
[
PhobosUtil
getAppVersion
];
[
self
setupNotification
];
[
self
handleSessionStart
];
[
self
synchronizePhobosKey
];
phobosLog
(
@"starts to orbit"
);
}
return
self
;
}
/**
* disk下的PhobosHaveOpenApp只要存在,就把他取出来放到document下(注:当不支持7.6.16版本的时候,干掉这个方法)
*/
-
(
void
)
synchronizePhobosKey
{
WMCacheService
*
cache
=
[
WMCacheService
sharedInstance
];
if
([
cache
fetchObjectAtDiskWithkey
:
PhobosHaveOpenApp
])
{
NSString
*
prefePath
=
[
NSSearchPathForDirectoriesInDomains
(
NSDocumentDirectory
,
NSUserDomainMask
,
YES
)
objectAtIndex
:
0
];
prefePath
=
[
NSString
stringWithFormat
:
@"%@/com.tumblr.TMDiskCache.WMCacheShared/%@"
,
prefePath
,
PhobosHaveOpenApp
];
NSURL
*
fileUrl
=
[
NSURL
fileURLWithPathComponents
:@[
prefePath
]];
BOOL
written
=
[
NSKeyedArchiver
archiveRootObject
:
PhobosHaveOpenApp
toFile
:[
fileUrl
path
]];
}
}
-
(
void
)
dealloc
{
if
(
self
)
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
...
...
@@ -109,7 +122,7 @@ static NSString *sdkVersion = @"110";
/** 第一次打开APP埋点 **/
// 当不再支持7.6.15版本时,只保留
if
(
!
[
cache
fetchObjectAtD
iskWithkey
:
PhobosHaveOpenApp
]
||
!
[
cache
fetchObjectAtD
ucmentPathWithkey
:
PhobosHaveOpenApp
])
{
if
(
!
[
cache
fetchObjectAtDucmentPathWithkey
:
PhobosHaveOpenApp
])
{
[
Phobos
track
:
@"device_activated"
attributes
:@{}
sendNow
:
YES
];
[
Phobos
track
:
@"device_activated"
attributes
:@{}
sendNow
:
NO
];
[
cache
storeObjectAtDucmentPathWithkey
:
PhobosHaveOpenApp
object
:
PhobosHaveOpenApp
];
...
...
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