Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
618097b5
Commit
618097b5
authored
Dec 28, 2024
by
DavidHuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
使用短链分享
parent
6334cf05
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
32 deletions
+47
-32
YHLivePlayerViewController.swift
.../LivestreamSales(直播销售)/C/YHLivePlayerViewController.swift
+15
-29
YHShareManager.swift
galaxy/galaxy/Classes/Tools/Analytics/YHShareManager.swift
+32
-3
No files found.
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/C/YHLivePlayerViewController.swift
View file @
618097b5
...
@@ -433,39 +433,25 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
...
@@ -433,39 +433,25 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
return
return
}
}
// //直播 分享连接
// let components = AGCAppLinkingComponents()
// //通过urlPrefix属性设置为申请链接前缀中的链接前缀
// components.uriPrefix = "https://yinheapp.drcn.agconnect.link"
// //通过deepLink属性设置深度链接地址
// components.deepLink = "yinheapp://hkdiy-h5.galaxy-immi.com/galaxyapp?type=1&liveId=106"
// components.iosBundleId = Bundle.main.bundleIdentifier
// components.androidDeepLink = "yinheapp://hkdiy-h5.galaxy-immi.com/galaxyapp?type=1&liveId=106"
// components.androidPackageName = "com.galaxy.galaxyandroid"
// let url = components.buildLongLink()
DispatchQueue
.
global
()
.
async
{
DispatchQueue
.
global
()
.
async
{
if
let
url
=
YHShareManager
.
shared
.
createMutilShareUrl
(
type
:
1
,
param
:
[
"LiveID"
:
String
(
self
.
liveId
)])
{
YHShareManager
.
shared
.
createMutilShareShortUrl
(
type
:
1
,
param
:
[
"LiveID"
:
String
(
self
.
liveId
)])
{
shortUrl
,
error
in
let
tmpT
=
url
.
base64Encoded
??
""
//对deepLink使用 base64编码
if
let
url
=
shortUrl
{
var
oldUrl
=
liveModel
.
live_h5_url
let
tmpT
=
url
.
base64Encoded
??
""
//对deepLink使用 base64编码
if
oldUrl
.
contains
(
"?"
)
{
var
oldUrl
=
liveModel
.
live_h5_url
oldUrl
=
oldUrl
+
"&uid=
\(
YHLoginManager
.
shared
.
userModel
?
.
id
??
"0"
)
"
+
"&fromPlatform=iOS"
+
"&appDeepLink=
\(
tmpT
)
"
if
oldUrl
.
contains
(
"?"
)
{
}
else
{
oldUrl
=
oldUrl
+
"&appDeepLink=
\(
tmpT
)
"
oldUrl
=
oldUrl
+
"?uid=
\(
YHLoginManager
.
shared
.
userModel
?
.
id
??
"0"
)
"
+
"&fromPlatform=iOS"
+
"&appDeepLink=
\(
tmpT
)
"
}
else
{
oldUrl
=
oldUrl
+
"?appDeepLink=
\(
tmpT
)
"
}
DispatchQueue
.
main
.
async
{
YHShareAlertView
.
show
(
image
:
liveModel
.
live_image
,
title
:
"@"
+
liveModel
.
account
,
subMessage
:
liveModel
.
live_title
,
linkUrl
:
oldUrl
,
isLive
:
true
,
fromAiSale
:
true
)
}
return
}
}
DispatchQueue
.
main
.
async
{
DispatchQueue
.
main
.
async
{
YHShareAlertView
.
show
(
image
:
liveModel
.
live_image
,
title
:
"@"
+
liveModel
.
account
,
subMessage
:
liveModel
.
live_title
,
linkUrl
:
oldU
rl
,
isLive
:
true
,
fromAiSale
:
true
)
YHShareAlertView
.
show
(
image
:
liveModel
.
live_image
,
title
:
"@"
+
liveModel
.
account
,
subMessage
:
liveModel
.
live_title
,
linkUrl
:
liveModel
.
live_h5_u
rl
,
isLive
:
true
,
fromAiSale
:
true
)
}
}
return
}
DispatchQueue
.
main
.
async
{
YHShareAlertView
.
show
(
image
:
liveModel
.
live_image
,
title
:
"@"
+
liveModel
.
account
,
subMessage
:
liveModel
.
live_title
,
linkUrl
:
liveModel
.
live_h5_url
,
isLive
:
true
,
fromAiSale
:
true
)
}
}
}
}
}
}
...
...
galaxy/galaxy/Classes/Tools/Analytics/YHShareManager.swift
View file @
618097b5
...
@@ -279,7 +279,6 @@ extension YHShareManager {
...
@@ -279,7 +279,6 @@ extension YHShareManager {
return
nil
return
nil
}
}
//直播 分享连接
//直播 分享连接
let
components
=
AGCAppLinkingComponents
()
let
components
=
AGCAppLinkingComponents
()
...
@@ -294,10 +293,8 @@ extension YHShareManager {
...
@@ -294,10 +293,8 @@ extension YHShareManager {
if
let
value
=
param
[
item
],
!
value
.
isEmpty
{
if
let
value
=
param
[
item
],
!
value
.
isEmpty
{
linkUrl
=
linkUrl
+
"&"
+
item
+
"="
+
value
linkUrl
=
linkUrl
+
"&"
+
item
+
"="
+
value
}
}
}
}
components
.
deepLink
=
linkUrl
components
.
deepLink
=
linkUrl
components
.
iosBundleId
=
Bundle
.
main
.
bundleIdentifier
components
.
iosBundleId
=
Bundle
.
main
.
bundleIdentifier
components
.
androidDeepLink
=
linkUrl
//安卓平台调用不过 所以需要单独写出来
components
.
androidDeepLink
=
linkUrl
//安卓平台调用不过 所以需要单独写出来
...
@@ -306,4 +303,36 @@ extension YHShareManager {
...
@@ -306,4 +303,36 @@ extension YHShareManager {
let
url
=
components
.
buildLongLink
()
let
url
=
components
.
buildLongLink
()
return
url
.
absoluteString
return
url
.
absoluteString
}
}
func
createMutilShareShortUrl
(
type
:
Int
,
param
:
[
String
:
String
],
callBack
:
@escaping
((
String
?,
Error
?)
->
Void
))
{
if
type
<
1
{
callBack
(
nil
,
nil
)
return
}
//直播 分享连接
let
components
=
AGCAppLinkingComponents
()
//通过urlPrefix属性设置为申请链接前缀中的链接前缀
components
.
uriPrefix
=
YhConstant
.
DeepLink
.
urlPreUrlFix
//通过deepLink属性设置深度链接地址
var
linkUrl
=
YhConstant
.
DeepLink
.
url
+
"?"
+
"type=
\(
type
)
"
let
arrKey
=
param
.
keys
for
(
_
,
item
)
in
arrKey
.
enumerated
()
{
if
let
value
=
param
[
item
],
!
value
.
isEmpty
{
linkUrl
=
linkUrl
+
"&"
+
item
+
"="
+
value
}
}
components
.
deepLink
=
linkUrl
components
.
iosBundleId
=
Bundle
.
main
.
bundleIdentifier
components
.
androidDeepLink
=
linkUrl
//安卓平台调用不过 所以需要单独写出来
components
.
androidPackageName
=
"com.galaxy.galaxyandroid"
components
.
buildShortLink
{
shortLink
,
error
in
callBack
(
shortLink
?
.
url
.
absoluteString
,
error
)
}
}
}
}
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