Commit a44d0262 authored by 翟国钧's avatar 翟国钧

修改了sessionid为空的bug(方法调用时机有逻辑问题)

parent 0aad59e4
......@@ -28,7 +28,7 @@ PODS:
- GMLibrary/Network (0.0.1):
- AFNetworking (~> 2.6.1)
- GMLibrary/Cache (~> 0.0.1)
- GMPhobos (0.1.1):
- GMPhobos (0.1.2):
- GMLibrary (~> 0.0.1)
- TMCache (2.1.0)
......@@ -42,7 +42,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60
GMLibrary: c31039ad32bc93f866d6c3052c20acb8cf9c1568
GMPhobos: 8394056bb80461a7a653fded7b2e55966f8d86bb
GMPhobos: efde929e7f1030e9e94e4ec3bf76c632e51ff78e
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
COCOAPODS: 0.39.0
{
"name": "GMPhobos",
"version": "0.1.1",
"version": "0.1.2",
"summary": "GM statistic data sdk",
"description": "GM event track sdk.",
"homepage": "http://git.gengmei.cc/gengmeiios/GMPhobos",
......@@ -10,7 +10,7 @@
},
"source": {
"git": "http://git.gengmei.cc/gengmeiios/GMPhobos.git",
"tag": "0.1.1"
"tag": "0.1.2"
},
"platforms": {
"ios": "7.0"
......
......@@ -28,7 +28,7 @@ PODS:
- GMLibrary/Network (0.0.1):
- AFNetworking (~> 2.6.1)
- GMLibrary/Cache (~> 0.0.1)
- GMPhobos (0.1.1):
- GMPhobos (0.1.2):
- GMLibrary (~> 0.0.1)
- TMCache (2.1.0)
......@@ -42,7 +42,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60
GMLibrary: c31039ad32bc93f866d6c3052c20acb8cf9c1568
GMPhobos: 8394056bb80461a7a653fded7b2e55966f8d86bb
GMPhobos: efde929e7f1030e9e94e4ec3bf76c632e51ff78e
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
COCOAPODS: 0.39.0
......@@ -14,7 +14,7 @@
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = 'primary'
BlueprintIdentifier = '6A2E46CFEEB8627AC4CB275A'
BlueprintIdentifier = '21F127F524A4A5E24D582BBA'
BlueprintName = 'GMPhobos'
ReferencedContainer = 'container:Pods.xcodeproj'
BuildableName = 'GMPhobos.framework'>
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.1.1</string>
<string>0.1.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -8,7 +8,7 @@
Pod::Spec.new do |s|
s.name = "GMPhobos"
s.version = "0.1.1"
s.version = "0.1.2"
s.summary = "GM statistic data sdk"
# This description is used to generate tags and improve search results.
......@@ -26,7 +26,7 @@ Pod::Spec.new do |s|
# s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2"
s.license = 'MIT'
s.author = { "licong" => "licong@gmei.com" }
s.source = { :git => "http://git.gengmei.cc/gengmeiios/GMPhobos.git", :tag => "0.1.1" }
s.source = { :git => "http://git.gengmei.cc/gengmeiios/GMPhobos.git", :tag => "0.1.2" }
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
s.platform = :ios, '7.0'
......
......@@ -58,6 +58,7 @@ static NSString *sdkVersion = @"110";
_userId = 0;
_appVersion = [self getAppVersion];
[self setupNotification];
[self handleSessionStart];
[self handleEventAfterInit];
phobosLog(@"starts to orbit");
......@@ -224,26 +225,24 @@ static NSString *sdkVersion = @"110";
if (![self isNonEmpty:pageName]) {
return;
}
double enterTime = [[NSDate date] timeIntervalSince1970];
_pageEnterParam = [NSMutableDictionary dictionaryWithObjectsAndKeys:
pageName,@"page_name",
self.businessId,@"business_id",
self.refererPageName,@"referer",
@(enterTime),@"in",nil];
[self currentTime],@"in",nil];
}
- (void)onPageEnd{
double exitTime = [[NSDate date] timeIntervalSince1970];
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
@try {
[dict setObject:@(exitTime) forKey:@"out"];
[dict setObject:[self currentTime] forKey:@"out"];
[dict setObject:@([_pageEnterParam[@"in"] doubleValue]) forKey:@"in"];
[dict setObject:_pageEnterParam[@"page_name"] forKey:@"page_name"];
[dict setObject:_pageEnterParam[@"business_id"] forKey:@"business_id"];
[dict setObject:_pageEnterParam[@"referer"] forKey:@"referer"];
[dict setObject:@(NO) forKey:@"fake"];
[self track:@"PV" attributes:dict];
[self track:@"pv" attributes:dict];
[_pageEnterParam removeAllObjects];
}
@catch (NSException *exception) {
......@@ -370,7 +369,7 @@ static NSString *sdkVersion = @"110";
- (NSString *)currentTime {
NSDate *date = [NSDate date];
NSTimeInterval interval = [date timeIntervalSince1970];
NSString *timeIntervalStr = [NSString stringWithFormat:@"%.0f",interval];
NSString *timeIntervalStr = [NSString stringWithFormat:@"%ld",(long)interval];
return timeIntervalStr;
}
......@@ -391,7 +390,9 @@ static NSString *sdkVersion = @"110";
}
- (BOOL)isNonEmpty:(NSString *)string {
if (!string) {
return NO;
}
NSMutableCharacterSet *emptyStringSet = [[NSMutableCharacterSet alloc] init];
[emptyStringSet formUnionWithCharacterSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];
[emptyStringSet formUnionWithCharacterSet: [NSCharacterSet characterSetWithCharactersInString: @" "]];
......
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