Commit 7f64f01d authored by 翟国钧's avatar 翟国钧

修改PhobosHaveOpenApp同步的问题

parent 86351398
...@@ -58,12 +58,25 @@ static NSString *sdkVersion = @"110"; ...@@ -58,12 +58,25 @@ static NSString *sdkVersion = @"110";
_appVersion = [PhobosUtil getAppVersion]; _appVersion = [PhobosUtil getAppVersion];
[self setupNotification]; [self setupNotification];
[self handleSessionStart]; [self handleSessionStart];
[self synchronizePhobosKey];
phobosLog(@"starts to orbit"); phobosLog(@"starts to orbit");
} }
return self; 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{ - (void)dealloc{
if (self) { if (self) {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];
...@@ -109,7 +122,7 @@ static NSString *sdkVersion = @"110"; ...@@ -109,7 +122,7 @@ static NSString *sdkVersion = @"110";
/** 第一次打开APP埋点 **/ /** 第一次打开APP埋点 **/
// 当不再支持7.6.15版本时,只保留 // 当不再支持7.6.15版本时,只保留
if (![cache fetchObjectAtDiskWithkey:PhobosHaveOpenApp] || ![cache fetchObjectAtDucmentPathWithkey:PhobosHaveOpenApp]) { if (![cache fetchObjectAtDucmentPathWithkey:PhobosHaveOpenApp]) {
[Phobos track:@"device_activated" attributes:@{} sendNow:YES]; [Phobos track:@"device_activated" attributes:@{} sendNow:YES];
[Phobos track:@"device_activated" attributes:@{} sendNow:NO]; [Phobos track:@"device_activated" attributes:@{} sendNow:NO];
[cache storeObjectAtDucmentPathWithkey:PhobosHaveOpenApp object:PhobosHaveOpenApp]; [cache storeObjectAtDucmentPathWithkey:PhobosHaveOpenApp object:PhobosHaveOpenApp];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment