Commit 12909091 authored by 井庆林's avatar 井庆林

app_session_over

parent b8825c07
...@@ -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 = "2.0.1" s.version = "2.0.2"
s.summary = "GM statistic data sdk" s.summary = "GM statistic data sdk"
s.description = <<-DESC s.description = <<-DESC
......
...@@ -161,6 +161,11 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -161,6 +161,11 @@ NS_ASSUME_NONNULL_BEGIN
*/ */
- (void)onPVEnd:(UIResponder<PhobosPVProtocol> *)page; - (void)onPVEnd:(UIResponder<PhobosPVProtocol> *)page;
/**
* 为隐私弹窗触发on_app_session_over埋点使用
*/
- (void)handleAppInBackgound;
@end @end
@interface NewPhobos (UtilTest) @interface NewPhobos (UtilTest)
......
...@@ -136,9 +136,9 @@ static NewPhobos *_sharedClient; ...@@ -136,9 +136,9 @@ static NewPhobos *_sharedClient;
* @since 0.0.1 * @since 0.0.1
*/ */
- (void)setupNotification{ - (void)setupNotification{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAppFinishLaunch:) name:UIApplicationDidFinishLaunchingNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAppFinishLaunch) name:UIApplicationDidFinishLaunchingNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAppInForeground:) name:UIApplicationWillEnterForegroundNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAppInForeground) name:UIApplicationWillEnterForegroundNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAppInBackgound:) name:UIApplicationDidEnterBackgroundNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAppInBackgound) name:UIApplicationDidEnterBackgroundNotification object:nil];
} }
/** /**
...@@ -159,7 +159,7 @@ static NewPhobos *_sharedClient; ...@@ -159,7 +159,7 @@ static NewPhobos *_sharedClient;
* *
* @since 0.0.1 * @since 0.0.1
*/ */
- (void)handleAppFinishLaunch:(id)sender{ - (void)handleAppFinishLaunch {
phobosLog(@"handleAppFinishLaunch"); phobosLog(@"handleAppFinishLaunch");
[self handleSessionStart]; [self handleSessionStart];
[self handleEventDeviceOpened]; [self handleEventDeviceOpened];
...@@ -170,7 +170,7 @@ static NewPhobos *_sharedClient; ...@@ -170,7 +170,7 @@ static NewPhobos *_sharedClient;
* *
* @since 0.0.1 * @since 0.0.1
*/ */
- (void)handleAppInForeground:(id)sender{ - (void)handleAppInForeground {
phobosLog(@"handleAppInForeground"); phobosLog(@"handleAppInForeground");
[self handleSessionStart]; [self handleSessionStart];
[self handleEventDeviceOpened]; [self handleEventDeviceOpened];
...@@ -183,7 +183,7 @@ static NewPhobos *_sharedClient; ...@@ -183,7 +183,7 @@ static NewPhobos *_sharedClient;
* *
* @since 0.0.1 * @since 0.0.1
*/ */
- (void)handleAppInBackgound:(id)sender{ - (void)handleAppInBackgound {
phobosLog(@"handleAppInBackgound"); phobosLog(@"handleAppInBackgound");
[self handlePVEventAppInBackgound]; [self handlePVEventAppInBackgound];
[self handleSessionOver]; [self handleSessionOver];
......
...@@ -164,6 +164,11 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -164,6 +164,11 @@ NS_ASSUME_NONNULL_BEGIN
*/ */
- (void)onPVEnd:(UIResponder<PhobosPVProtocol> *)page; - (void)onPVEnd:(UIResponder<PhobosPVProtocol> *)page;
/**
* 为隐私弹窗触发on_app_session_over埋点使用
*/
- (void)handleAppInBackgound;
/** /**
* @author 翟国钧, 16-03-08 11:03:45 * @author 翟国钧, 16-03-08 11:03:45
* *
......
...@@ -129,9 +129,9 @@ static OldPhobos *sharedClient = nil; ...@@ -129,9 +129,9 @@ static OldPhobos *sharedClient = nil;
* @since 0.0.1 * @since 0.0.1
*/ */
- (void)setupNotification{ - (void)setupNotification{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAppFinishLaunch:) name:UIApplicationDidFinishLaunchingNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAppFinishLaunch) name:UIApplicationDidFinishLaunchingNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAppInForeground:) name:UIApplicationWillEnterForegroundNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAppInForeground) name:UIApplicationWillEnterForegroundNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAppInBackgound:) name:UIApplicationDidEnterBackgroundNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAppInBackgound) name:UIApplicationDidEnterBackgroundNotification object:nil];
} }
/** /**
...@@ -152,7 +152,7 @@ static OldPhobos *sharedClient = nil; ...@@ -152,7 +152,7 @@ static OldPhobos *sharedClient = nil;
* *
* @since 0.0.1 * @since 0.0.1
*/ */
- (void)handleAppFinishLaunch:(id)sender{ - (void)handleAppFinishLaunch {
phobosLog(@"handleAppFinishLaunch"); phobosLog(@"handleAppFinishLaunch");
[self handleSessionStart]; [self handleSessionStart];
[self handleEventDeviceOpened]; [self handleEventDeviceOpened];
...@@ -163,7 +163,7 @@ static OldPhobos *sharedClient = nil; ...@@ -163,7 +163,7 @@ static OldPhobos *sharedClient = nil;
* *
* @since 0.0.1 * @since 0.0.1
*/ */
- (void)handleAppInForeground:(id)sender{ - (void)handleAppInForeground {
phobosLog(@"handleAppInForeground"); phobosLog(@"handleAppInForeground");
[self handleSessionStart]; [self handleSessionStart];
[self handleEventDeviceOpened]; [self handleEventDeviceOpened];
...@@ -176,7 +176,7 @@ static OldPhobos *sharedClient = nil; ...@@ -176,7 +176,7 @@ static OldPhobos *sharedClient = nil;
* *
* @since 0.0.1 * @since 0.0.1
*/ */
- (void)handleAppInBackgound:(id)sender{ - (void)handleAppInBackgound {
phobosLog(@"handleAppInBackgound"); phobosLog(@"handleAppInBackgound");
[self handlePVEventAppInBackgound]; [self handlePVEventAppInBackgound];
[self handleSessionOver]; [self handleSessionOver];
......
...@@ -155,6 +155,10 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -155,6 +155,10 @@ NS_ASSUME_NONNULL_BEGIN
* @brief PV事件结束。当controller viewWillDisAppear时调用 * @brief PV事件结束。当controller viewWillDisAppear时调用
*/ */
- (void)onPVEnd:(UIResponder<PhobosPVProtocol> *)page; - (void)onPVEnd:(UIResponder<PhobosPVProtocol> *)page;
/**
* 为隐私弹窗触发on_app_session_over埋点使用
*/
- (void)handleAppInBackgound;
@end @end
......
...@@ -139,6 +139,17 @@ static BOOL isGray = NO; ...@@ -139,6 +139,17 @@ static BOOL isGray = NO;
[_oldPhobos onPVEnd:page]; [_oldPhobos onPVEnd:page];
} }
/**
* 为隐私弹窗触发on_app_session_over埋点使用
*/
- (void)handleAppInBackgound {
if (isGray) {
[_rePhobos handleAppInBackgound];
} else {
[_oldPhobos handleAppInBackgound];
}
}
- (void)setCaptureNullExpection:(void (^)(NSString * _Nonnull, NSDictionary * _Nonnull))captureNullExpection { - (void)setCaptureNullExpection:(void (^)(NSString * _Nonnull, NSDictionary * _Nonnull))captureNullExpection {
_captureNullExpection = captureNullExpection; _captureNullExpection = captureNullExpection;
_rePhobos.captureNullExpection = captureNullExpection; _rePhobos.captureNullExpection = captureNullExpection;
......
...@@ -16,7 +16,7 @@ typedef NS_ENUM (NSInteger, PhobosSigningType) { ...@@ -16,7 +16,7 @@ typedef NS_ENUM (NSInteger, PhobosSigningType) {
PhobosSigningTypeDebug PhobosSigningTypeDebug
}; };
static NSString *sdkVersion = @"2.0.1"; static NSString *sdkVersion = @"2.0.2";
#ifdef DEBUG #ifdef DEBUG
#define phobosLog(...) NSLog(@"[Phobos] %@",__VA_ARGS__) #define phobosLog(...) NSLog(@"[Phobos] %@",__VA_ARGS__)
......
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