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
4ea007a8
Commit
4ea007a8
authored
Dec 18, 2019
by
刘鹿杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GMPhobos 库referrer_link 参数名统一。
修改极光推送进入页面时,链路中referrer_link 链路清空问题
parent
1b3e234c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
12 deletions
+16
-12
Phobos.m
GMPhobos/Classes/Phobos.m
+1
-1
UIResponder+PhobosPV.h
GMPhobos/Classes/UIResponder+PhobosPV.h
+1
-1
UIResponder+PhobosPV.m
GMPhobos/Classes/UIResponder+PhobosPV.m
+14
-10
No files found.
GMPhobos/Classes/Phobos.m
View file @
4ea007a8
...
@@ -413,7 +413,7 @@ static NSString *sdkVersion = @"110";
...
@@ -413,7 +413,7 @@ static NSString *sdkVersion = @"110";
NSArray
*
referrerLink
=
sharedClient
.
visibleController
.
referrerLink
;
NSArray
*
referrerLink
=
sharedClient
.
visibleController
.
referrerLink
;
if
(
!
[
eventId
isEqualToString
:
@"page_view"
])
{
if
(
!
[
eventId
isEqualToString
:
@"page_view"
])
{
NSMutableDictionary
*
attributesParams
=
[
NSMutableDictionary
dictionaryWithDictionary
:
attributes
];
NSMutableDictionary
*
attributesParams
=
[
NSMutableDictionary
dictionaryWithDictionary
:
attributes
];
[
attributesParams
setValue
:
referrerLink
?
:
@[]
forKey
:
@"referrer_
L
ink"
];
[
attributesParams
setValue
:
referrerLink
?
:
@[]
forKey
:
@"referrer_
l
ink"
];
attributes
=
attributesParams
;
attributes
=
attributesParams
;
}
}
[
self
catchNullForEvent
:
eventId
attributes
:
attributes
];
[
self
catchNullForEvent
:
eventId
attributes
:
attributes
];
...
...
GMPhobos/Classes/UIResponder+PhobosPV.h
View file @
4ea007a8
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
-
(
void
)
initReferer
;
-
(
void
)
initReferer
;
/**
/**
//
只适用于链路中页面浏览PVLink
添加 refererLink 参数
//
// 适用于链路中页面浏览事件的统计
添加 refererLink 参数
*/
*/
-
(
void
)
initRefererLink
;
-
(
void
)
initRefererLink
;
...
...
GMPhobos/Classes/UIResponder+PhobosPV.m
View file @
4ea007a8
...
@@ -45,23 +45,27 @@
...
@@ -45,23 +45,27 @@
}
}
}
}
//
只适用于链路中页面浏览PVLink
添加 refererLink 参数
//
适用于链路中页面浏览事件的统计
添加 refererLink 参数
-
(
void
)
initRefererLink
{
-
(
void
)
initRefererLink
{
if
([
self
isKindOfClass
:[
UIViewController
class
]])
{
if
([
self
isKindOfClass
:[
UIViewController
class
]])
{
// 分present与navigation两种情况
// 分present与navigation两种情况
UIViewController
*
me
=
(
UIViewController
*
)
self
;
UIViewController
*
me
=
(
UIViewController
*
)
self
;
if
(
me
.
isPush
.
intValue
)
{
// 如果是推送进来的,结果页面的referrerLink 为空数组, 此处添加过滤。
objc_setAssociatedObject
(
self
,
@selector
(
referrerLink
),
@[],
OBJC_ASSOCIATION_RETAIN_NONATOMIC
);
return
;
}
if
(
me
.
presentingViewController
!=
nil
)
{
if
(
me
.
presentingViewController
!=
nil
)
{
// app全局只有一个navigation,发现此时用navigation.topViewController presentViewController时,最终使用的是navigation弹出的
// app全局只有一个navigation,发现此时用navigation.topViewController presentViewController时,最终使用的是navigation弹出的
// 所以此处要判断,如果是navigation弹出,最后还是要定位到topViewController
// 所以此处要判断,如果是navigation弹出,最后还是要定位到topViewController
if
([
me
.
presentingViewController
isKindOfClass
:[
UINavigationController
class
]])
{
if
([
me
.
presentingViewController
isKindOfClass
:[
UINavigationController
class
]])
{
UIViewController
*
top
=
((
UINavigationController
*
)
me
.
presentingViewController
).
topViewController
;
UIViewController
*
top
=
((
UINavigationController
*
)
me
.
presentingViewController
).
topViewController
;
NSMutableArray
*
temp
Referrer
Link
=
[
NSMutableArray
arrayWithArray
:
top
.
referrerLink
];
NSMutableArray
*
tempLink
=
[
NSMutableArray
arrayWithArray
:
top
.
referrerLink
];
[
temp
Referrer
Link
addObject
:
top
.
pageName
];
[
tempLink
addObject
:
top
.
pageName
];
objc_setAssociatedObject
(
self
,
@selector
(
referrerLink
),
temp
Referrer
Link
,
OBJC_ASSOCIATION_RETAIN_NONATOMIC
);
objc_setAssociatedObject
(
self
,
@selector
(
referrerLink
),
tempLink
,
OBJC_ASSOCIATION_RETAIN_NONATOMIC
);
}
else
{
}
else
{
NSMutableArray
*
temp
Referer
Link
=
[
NSMutableArray
arrayWithArray
:
me
.
presentingViewController
.
referrerLink
];
NSMutableArray
*
tempLink
=
[
NSMutableArray
arrayWithArray
:
me
.
presentingViewController
.
referrerLink
];
[
temp
Referer
Link
addObject
:
me
.
presentingViewController
.
pageName
];
[
tempLink
addObject
:
me
.
presentingViewController
.
pageName
];
objc_setAssociatedObject
(
self
,
@selector
(
referrerLink
),
temp
Referer
Link
,
OBJC_ASSOCIATION_RETAIN_NONATOMIC
);
objc_setAssociatedObject
(
self
,
@selector
(
referrerLink
),
tempLink
,
OBJC_ASSOCIATION_RETAIN_NONATOMIC
);
}
}
}
else
{
}
else
{
NSArray
*
navigationPool
=
((
UIViewController
*
)
self
).
navigationController
.
viewControllers
;
NSArray
*
navigationPool
=
((
UIViewController
*
)
self
).
navigationController
.
viewControllers
;
...
@@ -70,9 +74,9 @@
...
@@ -70,9 +74,9 @@
return
;
return
;
}
}
UIViewController
*
controller
=
navigationPool
[
refererIndex
];
UIViewController
*
controller
=
navigationPool
[
refererIndex
];
NSMutableArray
*
temp
Referrer
Link
=
[
NSMutableArray
arrayWithArray
:
controller
.
referrerLink
];
NSMutableArray
*
tempLink
=
[
NSMutableArray
arrayWithArray
:
controller
.
referrerLink
];
[
temp
Referrer
Link
addObject
:
controller
.
pageName
];
[
tempLink
addObject
:
controller
.
pageName
];
objc_setAssociatedObject
(
self
,
@selector
(
referrerLink
),
temp
Referrer
Link
,
OBJC_ASSOCIATION_RETAIN_NONATOMIC
);
objc_setAssociatedObject
(
self
,
@selector
(
referrerLink
),
tempLink
,
OBJC_ASSOCIATION_RETAIN_NONATOMIC
);
}
}
}
}
}
}
...
...
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