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
1b3e234c
Commit
1b3e234c
authored
Dec 17, 2019
by
刘鹿杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改referrer_link 参数
parent
a68c9258
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
19 deletions
+22
-19
Phobos.m
GMPhobos/Classes/Phobos.m
+7
-5
PhobosPVProtocol.h
GMPhobos/Classes/PhobosPVProtocol.h
+1
-1
UIResponder+PhobosPV.m
GMPhobos/Classes/UIResponder+PhobosPV.m
+14
-13
No files found.
GMPhobos/Classes/Phobos.m
View file @
1b3e234c
...
...
@@ -366,7 +366,7 @@ static NSString *sdkVersion = @"110";
[
dict
setObject
:
page
.
pageName
forKey
:
@"page_name"
];
[
dict
setObject
:
page
.
businessId
?:
@""
forKey
:
@"business_id"
];
[
dict
setObject
:
page
.
referer
?:
@""
forKey
:
@"referrer"
];
[
dict
setObject
:
page
.
refer
erLink
?
:
@[]
forKey
:
@"refe
rer_link"
];
[
dict
setObject
:
page
.
refer
rerLink
?
:
@[]
forKey
:
@"refer
rer_link"
];
[
dict
setObject
:
@
(
0
)
forKey
:
@"fake"
];
[
dict
setObject
:
page
.
referrerId
?
:
@""
forKey
:
@"referrer_id"
];
[
dict
setObject
:
page
.
extraParam
?
:
@""
forKey
:
@"extra_param"
];
...
...
@@ -410,10 +410,12 @@ static NSString *sdkVersion = @"110";
* @since 0.0.1
*/
-
(
NSDictionary
*
)
prepareDictionaryForEvent
:
(
NSString
*
)
eventId
attributes
:
(
NSDictionary
*
)
attributes
{
NSArray
*
refererLink
=
sharedClient
.
visibleController
.
refererLink
;
NSMutableDictionary
*
attributesParams
=
[
NSMutableDictionary
dictionaryWithDictionary
:
attributes
];
[
attributesParams
setValue
:
refererLink
?
:
@[]
forKey
:
@"referer_Link"
];
attributes
=
attributesParams
;
NSArray
*
referrerLink
=
sharedClient
.
visibleController
.
referrerLink
;
if
(
!
[
eventId
isEqualToString
:
@"page_view"
])
{
NSMutableDictionary
*
attributesParams
=
[
NSMutableDictionary
dictionaryWithDictionary
:
attributes
];
[
attributesParams
setValue
:
referrerLink
?
:
@[]
forKey
:
@"referrer_Link"
];
attributes
=
attributesParams
;
}
[
self
catchNullForEvent
:
eventId
attributes
:
attributes
];
NSMutableDictionary
*
dict
=
[[
NSMutableDictionary
alloc
]
init
];
@try
{
...
...
GMPhobos/Classes/PhobosPVProtocol.h
View file @
1b3e234c
...
...
@@ -78,7 +78,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
获取上一个页面链路的page_name link by 7.20.0 如果有此页面有page_name则添加 , 没有添加""
*/
@property
(
nonatomic
,
copy
)
NSArray
*
refererLink
;
@property
(
nonatomic
,
copy
)
NSArray
*
refer
r
erLink
;
@end
...
...
GMPhobos/Classes/UIResponder+PhobosPV.m
View file @
1b3e234c
...
...
@@ -55,13 +55,13 @@
// 所以此处要判断,如果是navigation弹出,最后还是要定位到topViewController
if
([
me
.
presentingViewController
isKindOfClass
:[
UINavigationController
class
]])
{
UIViewController
*
top
=
((
UINavigationController
*
)
me
.
presentingViewController
).
topViewController
;
NSMutableArray
*
tempRefer
erLink
=
[
NSMutableArray
arrayWithArray
:
top
.
refe
rerLink
];
[
tempRefererLink
addObject
:
top
.
pageName
];
objc_setAssociatedObject
(
self
,
@selector
(
pageLink
),
tempRefererLink
,
OBJC_ASSOCIATION_COPY
);
NSMutableArray
*
tempRefer
rerLink
=
[
NSMutableArray
arrayWithArray
:
top
.
refer
rerLink
];
[
tempRefer
r
erLink
addObject
:
top
.
pageName
];
objc_setAssociatedObject
(
self
,
@selector
(
referrerLink
),
tempReferrerLink
,
OBJC_ASSOCIATION_RETAIN_NONATOMIC
);
}
else
{
NSMutableArray
*
tempRefererLink
=
[
NSMutableArray
arrayWithArray
:
me
.
presentingViewController
.
refererLink
];
NSMutableArray
*
tempRefererLink
=
[
NSMutableArray
arrayWithArray
:
me
.
presentingViewController
.
refer
r
erLink
];
[
tempRefererLink
addObject
:
me
.
presentingViewController
.
pageName
];
objc_setAssociatedObject
(
self
,
@selector
(
pageLink
),
tempRefererLink
,
OBJC_ASSOCIATION_COPY
);
objc_setAssociatedObject
(
self
,
@selector
(
referrerLink
),
tempRefererLink
,
OBJC_ASSOCIATION_RETAIN_NONATOMIC
);
}
}
else
{
NSArray
*
navigationPool
=
((
UIViewController
*
)
self
).
navigationController
.
viewControllers
;
...
...
@@ -70,20 +70,21 @@
return
;
}
UIViewController
*
controller
=
navigationPool
[
refererIndex
];
NSMutableArray
*
tempRefer
erLink
=
[
NSMutableArray
arrayWithArray
:
controller
.
refe
rerLink
];
[
tempRefererLink
addObject
:
controller
.
pageName
];
objc_setAssociatedObject
(
self
,
@selector
(
refer
erLink
),
tempRefererLink
,
OBJC_ASSOCIATION_COPY
);
NSMutableArray
*
tempRefer
rerLink
=
[
NSMutableArray
arrayWithArray
:
controller
.
refer
rerLink
];
[
tempRefer
r
erLink
addObject
:
controller
.
pageName
];
objc_setAssociatedObject
(
self
,
@selector
(
refer
rerLink
),
tempReferrerLink
,
OBJC_ASSOCIATION_RETAIN_NONATOMIC
);
}
}
}
-
(
void
)
setRefer
erLink
:
(
NSArray
*
)
refe
rerLink
{
objc_setAssociatedObject
(
self
,
@selector
(
refer
erLink
),
refererLink
,
OBJC_ASSOCIATION_COPY
);
-
(
void
)
setRefer
rerLink
:
(
NSArray
*
)
refer
rerLink
{
objc_setAssociatedObject
(
self
,
@selector
(
refer
rerLink
),
referrerLink
,
OBJC_ASSOCIATION_RETAIN_NONATOMIC
);
}
-
(
NSArray
*
)
refererLink
{
NSArray
*
refererLink
=
objc_getAssociatedObject
(
self
,
@selector
(
refererLink
));
return
refererLink
;
-
(
NSArray
*
)
referrerLink
{
NSArray
*
referrerLink
=
objc_getAssociatedObject
(
self
,
@selector
(
referrerLink
));
return
referrerLink
;
}
/**
...
...
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