Commit 7c8cfbe5 authored by 汪洋's avatar 汪洋

Merge branch 'master' of git.gengmei.cc:gengmeiios/GMPhobos

parents d67e4477 105f420b
PODS: PODS:
- GMCache (0.1.1): - GMCache (0.1.1):
- TMCache (~> 2.1.0) - TMCache (~> 2.1.0)
- GMPhobos (0.3.3): - GMPhobos (0.3.4):
- GMCache (~> 0.1.1) - GMCache (~> 0.1.1)
- TMCache (2.1.0) - TMCache (2.1.0)
...@@ -14,7 +14,7 @@ EXTERNAL SOURCES: ...@@ -14,7 +14,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
GMCache: 73855b613b9d7e34f4f37ad425e8b8153b760c04 GMCache: 73855b613b9d7e34f4f37ad425e8b8153b760c04
GMPhobos: b8da648592cbf48e28ba1b4b79beaead236eb31b GMPhobos: cb3966785233960a28edf4323ee906f830fea01c
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
PODFILE CHECKSUM: 281ed5ce2f0e8e2e49cc13b1e4726e6686ac6095 PODFILE CHECKSUM: 281ed5ce2f0e8e2e49cc13b1e4726e6686ac6095
......
{ {
"name": "GMPhobos", "name": "GMPhobos",
"version": "0.3.3", "version": "0.3.4",
"summary": "GM statistic data sdk", "summary": "GM statistic data sdk",
"description": "GM event track sdk.", "description": "GM event track sdk.",
"homepage": "http://git.gengmei.cc/gengmeiios/GMPhobos", "homepage": "http://git.gengmei.cc/gengmeiios/GMPhobos",
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
}, },
"source": { "source": {
"git": "git@git.gengmei.cc:gengmeiios/GMPhobos.git", "git": "git@git.gengmei.cc:gengmeiios/GMPhobos.git",
"tag": "0.3.3" "tag": "0.3.4"
}, },
"platforms": { "platforms": {
"ios": "8.0" "ios": "8.0"
......
PODS: PODS:
- GMCache (0.1.1): - GMCache (0.1.1):
- TMCache (~> 2.1.0) - TMCache (~> 2.1.0)
- GMPhobos (0.3.3): - GMPhobos (0.3.4):
- GMCache (~> 0.1.1) - GMCache (~> 0.1.1)
- TMCache (2.1.0) - TMCache (2.1.0)
...@@ -14,7 +14,7 @@ EXTERNAL SOURCES: ...@@ -14,7 +14,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
GMCache: 73855b613b9d7e34f4f37ad425e8b8153b760c04 GMCache: 73855b613b9d7e34f4f37ad425e8b8153b760c04
GMPhobos: b8da648592cbf48e28ba1b4b79beaead236eb31b GMPhobos: cb3966785233960a28edf4323ee906f830fea01c
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
PODFILE CHECKSUM: 281ed5ce2f0e8e2e49cc13b1e4726e6686ac6095 PODFILE CHECKSUM: 281ed5ce2f0e8e2e49cc13b1e4726e6686ac6095
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.3.3</string> <string>0.3.4</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = "GMPhobos" s.name = "GMPhobos"
s.version = "0.3.4" s.version = "0.3.5"
s.summary = "GM statistic data sdk" s.summary = "GM statistic data sdk"
s.description = <<-DESC s.description = <<-DESC
......
...@@ -25,7 +25,8 @@ static NSString *sdkVersion = @"110"; ...@@ -25,7 +25,8 @@ static NSString *sdkVersion = @"110";
@property (strong, nonatomic) NSString *channelId; @property (strong, nonatomic) NSString *channelId;
@property (strong, nonatomic) NSString *appVersion; @property (strong, nonatomic) NSString *appVersion;
@property (strong, nonatomic) NSString *sessionId; @property (strong, nonatomic) NSString *sessionId;
/* 每一条埋点数据的物理ID,自增,生命周期和sessionId相同。特别注意:在sessionOver的时候,要把他置为0 */
@property (assign, nonatomic) NSInteger serialId;
@end @end
@implementation Phobos @implementation Phobos
...@@ -40,7 +41,6 @@ static NSString *sdkVersion = @"110"; ...@@ -40,7 +41,6 @@ static NSString *sdkVersion = @"110";
+ (void)setSharedClient:(Phobos *)client{ + (void)setSharedClient:(Phobos *)client{
sharedClient = client; sharedClient = client;
[sharedClient handleEventAfterInit];
} }
- (instancetype)initWithAppName:(NSString *)appName channelId:(NSString *)channelId{ - (instancetype)initWithAppName:(NSString *)appName channelId:(NSString *)channelId{
...@@ -87,9 +87,11 @@ static NSString *sdkVersion = @"110"; ...@@ -87,9 +87,11 @@ static NSString *sdkVersion = @"110";
} }
} }
- (void)handleEventAfterInit{ /**
在APP启动、从后台到前台的时候需要记录device_opened埋点
*/
- (void)handleEventDeviceOpened{
WMCacheService *cache = [WMCacheService sharedInstance]; WMCacheService *cache = [WMCacheService sharedInstance];
/** 每次打开APP埋点 **/ /** 每次打开APP埋点 **/
[Phobos track:@"device_opened" attributes:@{} sendNow:YES]; [Phobos track:@"device_opened" attributes:@{} sendNow:YES];
...@@ -137,6 +139,7 @@ static NSString *sdkVersion = @"110"; ...@@ -137,6 +139,7 @@ static NSString *sdkVersion = @"110";
* @since 0.0.1 * @since 0.0.1
*/ */
- (void)handleSessionStart{ - (void)handleSessionStart{
_serialId = 0;
_sessionId = [[NSUUID UUID] UUIDString]; _sessionId = [[NSUUID UUID] UUIDString];
WMCacheService *cache = [WMCacheService sharedInstance]; WMCacheService *cache = [WMCacheService sharedInstance];
[cache storeObjectAtDiskWithkey:PhobosBeginTime object:[PhobosUtil currentTime]]; [cache storeObjectAtDiskWithkey:PhobosBeginTime object:[PhobosUtil currentTime]];
...@@ -152,6 +155,7 @@ static NSString *sdkVersion = @"110"; ...@@ -152,6 +155,7 @@ static NSString *sdkVersion = @"110";
- (void)handleAppFinishLaunch:(id)sender{ - (void)handleAppFinishLaunch:(id)sender{
phobosLog(@"handleAppFinishLaunch"); phobosLog(@"handleAppFinishLaunch");
[self handleSessionStart]; [self handleSessionStart];
[self handleEventDeviceOpened];
} }
/** /**
...@@ -164,6 +168,7 @@ static NSString *sdkVersion = @"110"; ...@@ -164,6 +168,7 @@ static NSString *sdkVersion = @"110";
- (void)handleAppInForeground:(id)sender{ - (void)handleAppInForeground:(id)sender{
phobosLog(@"handleAppInForeground"); phobosLog(@"handleAppInForeground");
[self handleSessionStart]; [self handleSessionStart];
[self handleEventDeviceOpened];
[self fetchDataAndSend]; [self fetchDataAndSend];
[self handlePVEventAppInForeground]; [self handlePVEventAppInForeground];
} }
...@@ -200,6 +205,8 @@ static NSString *sdkVersion = @"110"; ...@@ -200,6 +205,8 @@ static NSString *sdkVersion = @"110";
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:usedTime,@"duration",nil]; NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:usedTime,@"duration",nil];
[Phobos track:@"on_app_session_over" attributes:dict]; [Phobos track:@"on_app_session_over" attributes:dict];
[cache removeObjectAtDiskWithkey:PhobosBeginTime]; [cache removeObjectAtDiskWithkey:PhobosBeginTime];
//当前session结束之后,把id置为0
_serialId = 0;
} }
/** /**
...@@ -345,7 +352,8 @@ static NSString *sdkVersion = @"110"; ...@@ -345,7 +352,8 @@ static NSString *sdkVersion = @"110";
self.appVersion, @"version", self.appVersion, @"version",
self.channelId,@"channel", self.channelId,@"channel",
_userType,@"user_type", _userType,@"user_type",
self.currentCityId,@"current_city_id", nil]; self.currentCityId,@"current_city_id",
@(_serialId++), @"serial_id",nil];
[dict setObject:eventId forKey:@"type"]; [dict setObject:eventId forKey:@"type"];
[dict setObject:appParams forKey:@"app"]; [dict setObject:appParams forKey:@"app"];
[dict setObject:sdkVersion forKey:@"version"]; [dict setObject:sdkVersion forKey:@"version"];
......
...@@ -27,6 +27,7 @@ xcode-select --install ...@@ -27,6 +27,7 @@ xcode-select --install
<td width="33%"><code>sudo gem install fastlane -NV</code></td> <td width="33%"><code>sudo gem install fastlane -NV</code></td>
</tr> </tr>
</table> </table>
# Available Actions # Available Actions
## iOS ## iOS
### ios do_deliver_app ### ios do_deliver_app
......
...@@ -5,77 +5,77 @@ ...@@ -5,77 +5,77 @@
<testcase classname="fastlane.lanes" name="00: Verifying required fastlane version" time="0.001926"> <testcase classname="fastlane.lanes" name="00: Verifying required fastlane version" time="0.003067">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="01: default_platform" time="0.001611"> <testcase classname="fastlane.lanes" name="01: default_platform" time="0.001746">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="02: import_from_git" time="0.564687"> <testcase classname="fastlane.lanes" name="02: import_from_git" time="0.926677">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="03: hipchat" time="0.057552"> <testcase classname="fastlane.lanes" name="03: hipchat" time="0.059709">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="04: git_pull" time="4.685103"> <testcase classname="fastlane.lanes" name="04: git_pull" time="6.059064">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="05: ensure_git_branch" time="0.008377"> <testcase classname="fastlane.lanes" name="05: ensure_git_branch" time="0.012919">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="06: pod_install" time="23.279199"> <testcase classname="fastlane.lanes" name="06: pod_install" time="56.315248">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="07: pod_lib_lint" time="31.215696"> <testcase classname="fastlane.lanes" name="07: pod_lib_lint" time="47.255832">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="08: version_bump_podspec" time="0.003827"> <testcase classname="fastlane.lanes" name="08: version_bump_podspec" time="0.003115">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="09: git_commit_all" time="0.092723"> <testcase classname="fastlane.lanes" name="09: git_commit_all" time="0.134571">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="10: add_git_tag" time="0.013386"> <testcase classname="fastlane.lanes" name="10: add_git_tag" time="0.017036">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="11: push_to_git_remote" time="0.945879"> <testcase classname="fastlane.lanes" name="11: push_to_git_remote" time="0.952986">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="12: pod_push" time="7.915278"> <testcase classname="fastlane.lanes" name="12: pod_push" time="14.999287">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="13: pod_repo_update" time="7.848292"> <testcase classname="fastlane.lanes" name="13: pod_repo_update" time="13.049198">
</testcase> </testcase>
<testcase classname="fastlane.lanes" name="14: hipchat" time="0.600016"> <testcase classname="fastlane.lanes" name="14: hipchat" time="0.521391">
</testcase> </testcase>
......
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