Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sdk-public
unity_sdk_demo
Commits
002db533
Commit
002db533
authored
Nov 11, 2025
by
fengchao
Browse files
fix(code):修改iOS分享
parent
eaa6b224
Changes
3
Show whitespace changes
Inline
Side-by-side
Assets/Plugins/iOS/UnityBridge.mm
View file @
002db533
...
@@ -266,14 +266,21 @@ extern "C" {
...
@@ -266,14 +266,21 @@ extern "C" {
[
sdk
pay
:
payInfo
];
[
sdk
pay
:
payInfo
];
}
}
void
_StartShare
(
int
shareType
,
const
char
*
title
,
const
char
*
imagePath
,
const
char
*
url
)
{
void
_StartShare
(
int
shareType
,
const
char
*
jsonInfo
)
{
NSLog
(
@"🍎 调用SDK分享"
);
NSLog
(
@"🍎 调用SDK分享"
);
AccessCoreSdk
*
sdk
=
[
AccessCoreSdk
shareAccessCoreSdkManage
];
AccessCoreSdk
*
sdk
=
[
AccessCoreSdk
shareAccessCoreSdkManage
];
NSString
*
jsonStr
=
[
NSString
stringWithUTF8String
:
jsonInfo
];
NSData
*
jsonData
=
[
jsonStr
dataUsingEncoding
:
NSUTF8StringEncoding
];
NSError
*
error
=
nil
;
NSDictionary
*
jsonDict
=
[
NSJSONSerialization
JSONObjectWithData
:
jsonData
options
:
0
error
:&
error
];
if
(
error
)
return
;
AccessShareInfo
*
shareInfo
=
[[
AccessShareInfo
alloc
]
init
];
AccessShareInfo
*
shareInfo
=
[[
AccessShareInfo
alloc
]
init
];
shareInfo
.
title
=
[
NSString
stringWith
UTF8String
:
title
];
shareInfo
.
title
=
[
NSString
stringWith
Format
:
@"%@"
,
jsonDict
[
@"
title
"
]
];
shareInfo
.
imagePath
=
[
NSString
stringWith
UTF8String
:
image
Path
];
shareInfo
.
imagePath
=
[
NSString
stringWith
Format
:
@"%@"
,
jsonDict
[
@"pic
Path
"
]
];
shareInfo
.
linkPath
=
[
NSString
stringWith
UTF8String
:
url
];
shareInfo
.
linkPath
=
[
NSString
stringWith
Format
:
@"%@"
,
jsonDict
[
@"shareUrl"
]
];
[
sdk
shareType
:(
THREE_SHARE_TYPE
)
shareType
shareObject
:
shareInfo
];
[
sdk
shareType
:(
THREE_SHARE_TYPE
)
shareType
shareObject
:
shareInfo
];
}
}
...
...
Assets/Scripts/sdk/channel/IosSdkInterface.cs
View file @
002db533
...
@@ -15,7 +15,7 @@ public class IosSdkInterface
...
@@ -15,7 +15,7 @@ public class IosSdkInterface
[
DllImport
(
"__Internal"
)]
private
static
extern
void
_StartPay
(
string
jsonInfo
);
[
DllImport
(
"__Internal"
)]
private
static
extern
void
_StartPay
(
string
jsonInfo
);
// 分享功能
// 分享功能
[
DllImport
(
"__Internal"
)]
private
static
extern
void
_StartShare
(
int
shareType
,
string
title
,
string
content
,
string
url
);
[
DllImport
(
"__Internal"
)]
private
static
extern
void
_StartShare
(
int
shareType
,
string
jsonInfo
);
// 数据上报
// 数据上报
[
DllImport
(
"__Internal"
)]
private
static
extern
void
_ReportUserInfoFull
(
int
eventType
,
string
jsonInfo
);
[
DllImport
(
"__Internal"
)]
private
static
extern
void
_ReportUserInfoFull
(
int
eventType
,
string
jsonInfo
);
...
@@ -50,9 +50,9 @@ public class IosSdkInterface
...
@@ -50,9 +50,9 @@ public class IosSdkInterface
_StartPay
(
json
);
_StartPay
(
json
);
}
}
public
static
void
StartShare
(
int
shareType
,
string
title
,
string
imagePath
,
string
url
)
public
static
void
StartShare
(
int
shareType
,
string
jsonstr
)
{
{
_StartShare
(
shareType
,
title
,
imagePath
,
url
);
_StartShare
(
shareType
,
jsonstr
);
}
}
public
static
void
ReportUserInfoFull
(
EventType
eventType
,
string
jsonStr
)
public
static
void
ReportUserInfoFull
(
EventType
eventType
,
string
jsonStr
)
...
...
Assets/Scripts/sdk/core/HoolaiSdkManager.cs
View file @
002db533
...
@@ -111,7 +111,7 @@ public static class HoolaiSdkManager
...
@@ -111,7 +111,7 @@ public static class HoolaiSdkManager
#elif UNITY_IOS && !UNITY_EDITOR
#elif UNITY_IOS && !UNITY_EDITOR
// iOS 分享参数解析(可根据需要扩展)
// iOS 分享参数解析(可根据需要扩展)
Debug
.
Log
(
"【UnifiedSdkManager】iOS 分享暂未实现完整解析"
);
Debug
.
Log
(
"【UnifiedSdkManager】iOS 分享暂未实现完整解析"
);
IosSdkInterface
.
StartShare
(
shareType
,
"Title"
,
"Content"
,
"https://example.com"
);
IosSdkInterface
.
StartShare
(
type
,
jsonStr
);
#else
#else
Debug
.
Log
(
$"【UnifiedSdkManager】模拟调用:分享,平台=
{
shareType
}
"
);
Debug
.
Log
(
$"【UnifiedSdkManager】模拟调用:分享,平台=
{
shareType
}
"
);
#endif
#endif
...
...
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