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
b6caaf6e
Commit
b6caaf6e
authored
Dec 23, 2024
by
DavidHuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、生成直播链接
2、直播链接跳转直播间
parent
79157be7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
109 additions
and
5 deletions
+109
-5
AppDelegate.swift
galaxy/galaxy/AppDelegate.swift
+34
-2
YHLivePlayerViewController.swift
.../LivestreamSales(直播销售)/C/YHLivePlayerViewController.swift
+27
-2
YHLiveDetailModel.swift
...s/Modules/LivestreamSales(直播销售)/M/YHLiveDetailModel.swift
+1
-1
YHShareManager.swift
galaxy/galaxy/Classes/Tools/Analytics/YHShareManager.swift
+39
-0
YhConstant.swift
galaxy/galaxy/Classes/Tools/Helper/YhConstant.swift
+8
-0
No files found.
galaxy/galaxy/AppDelegate.swift
View file @
b6caaf6e
...
...
@@ -69,8 +69,40 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
AGCInstance
.
startUp
()
AGCAppLinking
.
instance
()
.
handle
{
(
link
,
error
)
in
let
deepLink
=
link
?
.
deepLink
//TODO: 增加deeplink地址跳转
if
let
deepLink
=
link
?
.
deepLink
,
deepLink
.
contains
(
YhConstant
.
DeepLink
.
compareUrl
)
{
if
let
url
=
URL
(
string
:
deepLink
)
{
let
components
=
URLComponents
(
url
:
url
,
resolvingAgainstBaseURL
:
false
)
if
let
queryItems
=
components
?
.
queryItems
{
var
arrItems
:
[
String
:
Any
]
=
[:]
for
item
in
queryItems
{
if
let
value
=
item
.
value
{
arrItems
.
updateValue
(
value
,
forKey
:
item
.
name
)
}
}
if
arrItems
.
count
>
0
{
if
let
type
=
arrItems
[
"type"
]
as?
String
,
let
iType
=
Int
(
type
)
{
if
iType
==
1
{
//跳转
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
0.5
)
{
if
!
YHLoginManager
.
shared
.
isLogin
()
{
printLog
(
"需要登录"
)
return
}
//直播 - 获取它对应的参数
if
let
liveId
=
arrItems
[
"LiveID"
]
as?
String
{
let
playbackInfo
=
YHPlayerManager
.
PlaybackInfo
(
id
:
liveId
.
intValue
(),
isLive
:
true
,
isFromSaleDetail
:
true
)
YHPlayerManager
.
shared
.
enterLive
(
from
:
nil
,
playbackInfo
:
playbackInfo
)
}
}
}
else
{
}
}
}
}
}
}
}
// QiYu SDK初始化
...
...
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/C/YHLivePlayerViewController.swift
View file @
b6caaf6e
...
...
@@ -8,8 +8,8 @@
import
AgoraRtcKit
import
HyphenateChat
//import AVKit
import
UIKit
import
AGConnectAppLinking
class
YHLivePlayerViewController
:
YHBasePlayerViewController
{
// MARK: - Properties
...
...
@@ -416,7 +416,32 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
guard
let
liveModel
=
viewModel
.
liveDetailModel
else
{
return
}
YHShareAlertView
.
show
(
image
:
liveModel
.
live_image
,
title
:
"@"
+
liveModel
.
account
,
subMessage
:
liveModel
.
live_title
,
linkUrl
:
liveModel
.
live_h5_url
,
isLive
:
true
,
fromAiSale
:
true
)
// //直播 分享连接
// 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
{
if
let
url
=
YHShareManager
.
shared
.
createMutilShareUrl
(
type
:
1
,
param
:
[
"LiveID"
:
"106"
])
{
printLog
(
url
)
//for test hjl
}
// printLog(url.absoluteString)
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
)
}
}
}
private
func
showGoods
()
{
...
...
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/M/YHLiveDetailModel.swift
View file @
b6caaf6e
...
...
@@ -16,7 +16,7 @@ class YHLiveDetailModel: SmartCodable {
var
hxUid
:
String
=
""
var
access_num
:
String
=
""
var
tips
:
String
=
""
//
1:直播中 2:未直播 0:未知状态
3:结束直播
//
0:未知状态 1:直播中 2:未直播
3:结束直播
var
status
:
Int
=
0
// 1:正常 2:播放中 3:禁推---(当status==1才监测,3代表离开了)
var
stream_status
:
Int
=
0
...
...
galaxy/galaxy/Classes/Tools/Analytics/YHShareManager.swift
View file @
b6caaf6e
...
...
@@ -8,6 +8,7 @@
import
UIKit
import
Alamofire
import
AGConnectAppLinking
class
YHShareManager
:
NSObject
{
static
let
shared
=
YHShareManager
()
...
...
@@ -267,4 +268,42 @@ extension YHShareManager {
WXApi
.
send
(
miniProgram
)
}
/*
生成多平台分享链接,完成回环操作
type : 业务类型 1-直播
param : 业务对应的参数
*/
func
createMutilShareUrl
(
type
:
Int
,
param
:
[
String
:
String
])
->
String
?
{
if
type
<
1
{
return
nil
}
//直播 分享连接
let
components
=
AGCAppLinkingComponents
()
//通过urlPrefix属性设置为申请链接前缀中的链接前缀
components
.
uriPrefix
=
"https://yinheapp.drcn.agconnect.link"
//通过deepLink属性设置深度链接地址
var
linkUrl
=
YhConstant
.
DeepLink
.
url
+
"?"
+
"type=
\(
type
)
"
let
arrKey
=
param
.
keys
for
(
index
,
item
)
in
arrKey
.
enumerated
()
{
if
let
value
=
param
[
item
],
!
value
.
isEmpty
,
let
value2
=
YHURLEncodeHelper
.
urlEncodedString
(
value
)
{
linkUrl
=
linkUrl
+
"&"
+
item
+
"="
+
value2
}
}
components
.
deepLink
=
linkUrl
components
.
iosBundleId
=
Bundle
.
main
.
bundleIdentifier
components
.
androidDeepLink
=
linkUrl
//安卓平台调用不过 所以需要单独写出来
components
.
androidPackageName
=
"com.galaxy.galaxyandroid"
let
url
=
components
.
buildLongLink
()
return
url
.
absoluteString
}
}
galaxy/galaxy/Classes/Tools/Helper/YhConstant.swift
View file @
b6caaf6e
...
...
@@ -237,6 +237,14 @@ class YhConstant {
extension
YhConstant
{
//DeepLink 常量
struct
DeepLink
{
static
let
url
=
"yinheapp://hkdiy-h5.galaxy-immi.com/galaxyapp"
static
let
compareUrl
=
"yinheapp://hkdiy-h5.galaxy-immi.com/galaxyapp?type="
}
// MARK: - 环信IM
struct
IM
{
...
...
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