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
436af19b
Commit
436af19b
authored
Jun 23, 2020
by
jz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改isFirst 避免冲突
parent
d533b269
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
15 deletions
+15
-15
NewPhobos.m
GMPhobos/Classes/NewPhobos.m
+5
-5
OldPhobos.m
GMPhobos/Classes/OldPhobos.m
+5
-5
PhobosPVProtocol.h
GMPhobos/Classes/PhobosPVProtocol.h
+2
-2
UIResponder+PhobosPV.m
GMPhobos/Classes/UIResponder+PhobosPV.m
+3
-3
No files found.
GMPhobos/Classes/NewPhobos.m
View file @
436af19b
...
@@ -262,8 +262,8 @@ static dispatch_semaphore_t _phobos_semaphore;
...
@@ -262,8 +262,8 @@ static dispatch_semaphore_t _phobos_semaphore;
-
(
void
)
onPVEnd
:
(
UIResponder
<
PhobosPVProtocol
>
*
)
page
{
-
(
void
)
onPVEnd
:
(
UIResponder
<
PhobosPVProtocol
>
*
)
page
{
if
(
!
[
PhobosUtil
isNonEmpty
:
page
.
pageName
]
||
!
page
.
needLogPV
)
{
if
(
!
[
PhobosUtil
isNonEmpty
:
page
.
pageName
]
||
!
page
.
needLogPV
)
{
if
(
!
page
.
isFirst
)
{
if
(
!
page
.
isFirst
Entry
)
{
page
.
isFirst
=
YES
;
page
.
isFirst
Entry
=
YES
;
}
}
return
;
return
;
}
}
...
@@ -288,9 +288,9 @@ static dispatch_semaphore_t _phobos_semaphore;
...
@@ -288,9 +288,9 @@ static dispatch_semaphore_t _phobos_semaphore;
[
dict
setObject
:
PhobosSafeString
(
page
.
inTimeMillis
)
forKey
:
@"in_time_millis"
];
[
dict
setObject
:
PhobosSafeString
(
page
.
inTimeMillis
)
forKey
:
@"in_time_millis"
];
[
dict
setObject
:
PhobosSafeString
([
PhobosUtil
currentMMTime
])
forKey
:
@"out_time_millis"
];
[
dict
setObject
:
PhobosSafeString
([
PhobosUtil
currentMMTime
])
forKey
:
@"out_time_millis"
];
//首次进来为1,再次进入的时候都为0
//首次进来为1,再次进入的时候都为0
[
dict
setObject
:
page
.
isFirst
?
@
(
0
):
@
(
1
)
forKey
:
@"is_first"
];
[
dict
setObject
:
page
.
isFirst
Entry
?
@
(
0
):
@
(
1
)
forKey
:
@"is_first"
];
if
(
!
page
.
isFirst
)
{
if
(
!
page
.
isFirst
Entry
)
{
page
.
isFirst
=
YES
;
page
.
isFirst
Entry
=
YES
;
}
}
if
(
page
.
inTime
.
length
>
0
)
{
if
(
page
.
inTime
.
length
>
0
)
{
// 页面显示时间为空时不记录页面pv事件
// 页面显示时间为空时不记录页面pv事件
...
...
GMPhobos/Classes/OldPhobos.m
View file @
436af19b
...
@@ -340,8 +340,8 @@ static OldPhobos *sharedClient = nil;
...
@@ -340,8 +340,8 @@ static OldPhobos *sharedClient = nil;
-
(
void
)
onPVEnd
:
(
UIResponder
<
PhobosPVProtocol
>
*
)
page
{
-
(
void
)
onPVEnd
:
(
UIResponder
<
PhobosPVProtocol
>
*
)
page
{
if
(
!
[
PhobosUtil
isNonEmpty
:
page
.
pageName
]
||
!
page
.
needLogPV
)
{
if
(
!
[
PhobosUtil
isNonEmpty
:
page
.
pageName
]
||
!
page
.
needLogPV
)
{
if
(
!
page
.
isFirst
)
{
if
(
!
page
.
isFirst
Entry
)
{
page
.
isFirst
=
YES
;
page
.
isFirst
Entry
=
YES
;
}
}
return
;
return
;
}
}
...
@@ -366,9 +366,9 @@ static OldPhobos *sharedClient = nil;
...
@@ -366,9 +366,9 @@ static OldPhobos *sharedClient = nil;
[
dict
setObject
:
PhobosSafeString
(
page
.
inTimeMillis
)
forKey
:
@"in_time_millis"
];
[
dict
setObject
:
PhobosSafeString
(
page
.
inTimeMillis
)
forKey
:
@"in_time_millis"
];
[
dict
setObject
:
PhobosSafeString
([
PhobosUtil
currentMMTime
])
forKey
:
@"out_time_millis"
];
[
dict
setObject
:
PhobosSafeString
([
PhobosUtil
currentMMTime
])
forKey
:
@"out_time_millis"
];
//首次进来为1,再次进入的时候都为0
//首次进来为1,再次进入的时候都为0
[
dict
setObject
:
page
.
isFirst
?
@
(
0
):
@
(
1
)
forKey
:
@"is_first"
];
[
dict
setObject
:
page
.
isFirst
Entry
?
@
(
0
):
@
(
1
)
forKey
:
@"is_first"
];
if
(
!
page
.
isFirst
)
{
if
(
!
page
.
isFirst
Entry
)
{
page
.
isFirst
=
YES
;
page
.
isFirst
Entry
=
YES
;
}
}
if
(
page
.
inTime
.
length
>
0
)
{
if
(
page
.
inTime
.
length
>
0
)
{
// 页面显示时间为空时不记录页面pv事件
// 页面显示时间为空时不记录页面pv事件
...
...
GMPhobos/Classes/PhobosPVProtocol.h
View file @
436af19b
...
@@ -91,9 +91,9 @@ typedef void(^PhobosUpdatePVBlock)(void);
...
@@ -91,9 +91,9 @@ typedef void(^PhobosUpdatePVBlock)(void);
@property
(
nonatomic
,
strong
)
NSArray
*
referrerLink
;
@property
(
nonatomic
,
strong
)
NSArray
*
referrerLink
;
/**
/**
是否是第一次来到这个页面,在viewDidLoad赋值为1
是否是第一次来到这个页面,在viewDidLoad赋值为1
在即将消失的方法赋值为0
在即将消失的方法赋值为0
(是否是首次上报)
*/
*/
@property
(
nonatomic
,
assign
)
BOOL
isFirst
;
@property
(
nonatomic
,
assign
)
BOOL
isFirst
Entry
;
/// 业务层更新PVStart信息
/// 业务层更新PVStart信息
@property
(
nonatomic
,
copy
)
PhobosUpdatePVBlock
updatePVStartBlock
;
@property
(
nonatomic
,
copy
)
PhobosUpdatePVBlock
updatePVStartBlock
;
...
...
GMPhobos/Classes/UIResponder+PhobosPV.m
View file @
436af19b
...
@@ -254,11 +254,11 @@
...
@@ -254,11 +254,11 @@
objc_setAssociatedObject
(
self
,
@selector
(
updatePVStartBlock
),
updatePVStartBlock
,
OBJC_ASSOCIATION_COPY_NONATOMIC
);
objc_setAssociatedObject
(
self
,
@selector
(
updatePVStartBlock
),
updatePVStartBlock
,
OBJC_ASSOCIATION_COPY_NONATOMIC
);
}
}
-
(
void
)
setIsFirst
:
(
BOOL
)
isFirst
{
-
(
void
)
setIsFirst
Entry
:
(
BOOL
)
isFirstEntry
{
objc_setAssociatedObject
(
self
,
@selector
(
isFirst
),
@
(
isFirst
),
OBJC_ASSOCIATION_ASSIGN
);
objc_setAssociatedObject
(
self
,
@selector
(
isFirst
Entry
),
@
(
isFirstEntry
),
OBJC_ASSOCIATION_ASSIGN
);
}
}
-
(
BOOL
)
isFirst
{
-
(
BOOL
)
isFirstEntry
{
NSNumber
*
num
=
objc_getAssociatedObject
(
self
,
_cmd
);
NSNumber
*
num
=
objc_getAssociatedObject
(
self
,
_cmd
);
return
[
num
boolValue
];
return
[
num
boolValue
];
}
}
...
...
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