Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-fluwx
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
openSourceLibrary
clx-fluwx
Commits
d603a5fb
提交
d603a5fb
authored
8月 22, 2018
作者:
JarvanMo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ios share
上级
451f258e
全部展开
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
56 行增加
和
18 行删除
+56
-18
FluwxShareHandler.kt
...main/kotlin/com/jarvan/fluwx/handler/FluwxShareHandler.kt
+4
-4
AppDelegate.m
example/ios/Runner/AppDelegate.m
+16
-0
Info.plist
example/ios/Runner/Info.plist
+10
-12
FluwxPlugin.m
ios/Classes/FluwxPlugin.m
+1
-1
FluwxShareHandler.m
ios/Classes/handler/FluwxShareHandler.m
+0
-0
WXApiRequestHandler.h
ios/Classes/wechat/WXApiRequestHandler.h
+15
-0
WXApiRequestHandler.m
ios/Classes/wechat/WXApiRequestHandler.m
+0
-0
wechat_share_models.dart
lib/src/models/wechat_share_models.dart
+10
-1
没有找到文件。
android/src/main/kotlin/com/jarvan/fluwx/handler/FluwxShareHandler.kt
浏览文件 @
d603a5fb
...
@@ -135,12 +135,12 @@ object FluwxShareHandler {
...
@@ -135,12 +135,12 @@ object FluwxShareHandler {
miniProgramObj
.
miniprogramType
=
call
.
argument
(
"miniProgramType"
)
// 正式版:0,测试版:1,体验版:2
miniProgramObj
.
miniprogramType
=
call
.
argument
(
"miniProgramType"
)
// 正式版:0,测试版:1,体验版:2
miniProgramObj
.
userName
=
call
.
argument
(
"userName"
)
// 小程序原始id
miniProgramObj
.
userName
=
call
.
argument
(
"userName"
)
// 小程序原始id
miniProgramObj
.
path
=
call
.
argument
(
"path"
)
//小程序页面路径
miniProgramObj
.
path
=
call
.
argument
(
"path"
)
//小程序页面路径
miniProgramObj
.
withShareTicket
=
call
.
argument
(
"withShareTicket"
)
val
msg
=
WXMediaMessage
(
miniProgramObj
)
val
msg
=
WXMediaMessage
(
miniProgramObj
)
msg
.
title
=
call
.
argument
(
"title"
)
// 小程序消息title
msg
.
title
=
call
.
argument
(
WechatPluginKeys
.
TITLE
)
// 小程序消息title
msg
.
description
=
call
.
argument
(
"description"
)
// 小程序消息desc
msg
.
description
=
call
.
argument
(
"description"
)
// 小程序消息desc
val
thumbnail
:
String
?
=
call
.
argument
(
WechatPluginKeys
.
THUMBNAIL
)
val
thumbnail
:
String
?
=
call
.
argument
(
WechatPluginKeys
.
THUMBNAIL
)
launch
{
launch
{
if
(
thumbnail
.
isNullOrBlank
())
{
if
(
thumbnail
.
isNullOrBlank
())
{
msg
.
thumbData
=
null
msg
.
thumbData
=
null
...
@@ -234,7 +234,7 @@ object FluwxShareHandler {
...
@@ -234,7 +234,7 @@ object FluwxShareHandler {
val
music
=
WXMusicObject
()
val
music
=
WXMusicObject
()
val
musicUrl
:
String
?
=
call
.
argument
(
"musicUrl"
)
val
musicUrl
:
String
?
=
call
.
argument
(
"musicUrl"
)
val
musicLowBandUrl
:
String
?
=
call
.
argument
(
"musicLowBandUrl"
)
val
musicLowBandUrl
:
String
?
=
call
.
argument
(
"musicLowBandUrl"
)
if
(
musicUrl
!=
null
)
{
if
(
musicUrl
!=
null
&&
musicUrl
.
isNotBlank
()
)
{
music
.
musicUrl
=
musicUrl
music
.
musicUrl
=
musicUrl
music
.
musicDataUrl
=
call
.
argument
(
"musicDataUrl"
)
music
.
musicDataUrl
=
call
.
argument
(
"musicDataUrl"
)
}
else
{
}
else
{
...
@@ -265,7 +265,7 @@ object FluwxShareHandler {
...
@@ -265,7 +265,7 @@ object FluwxShareHandler {
val
video
=
WXVideoObject
()
val
video
=
WXVideoObject
()
val
videoUrl
:
String
?
=
call
.
argument
(
"videoUrl"
)
val
videoUrl
:
String
?
=
call
.
argument
(
"videoUrl"
)
val
videoLowBandUrl
:
String
?
=
call
.
argument
(
"videoLowBandUrl"
)
val
videoLowBandUrl
:
String
?
=
call
.
argument
(
"videoLowBandUrl"
)
if
(
videoUrl
!=
null
)
{
if
(
videoUrl
!=
null
&&
videoUrl
.
isNotBlank
()
)
{
video
.
videoUrl
=
videoUrl
video
.
videoUrl
=
videoUrl
}
else
{
}
else
{
video
.
videoLowBandUrl
=
videoLowBandUrl
video
.
videoLowBandUrl
=
videoLowBandUrl
...
...
example/ios/Runner/AppDelegate.m
浏览文件 @
d603a5fb
...
@@ -11,4 +11,20 @@
...
@@ -11,4 +11,20 @@
return
[
super
application
:
application
didFinishLaunchingWithOptions
:
launchOptions
];
return
[
super
application
:
application
didFinishLaunchingWithOptions
:
launchOptions
];
}
}
-
(
void
)
applicationWillResignActive
:(
UIApplication
*
)
application
{
}
-
(
void
)
applicationDidEnterBackground
:(
UIApplication
*
)
application
{
}
-
(
void
)
applicationWillEnterForeground
:(
UIApplication
*
)
application
{
}
-
(
void
)
applicationDidBecomeActive
:(
UIApplication
*
)
application
{
}
-
(
void
)
applicationWillTerminate
:(
UIApplication
*
)
application
{
}
@end
@end
example/ios/Runner/Info.plist
浏览文件 @
d603a5fb
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
string
>
en
<
/string
>
<
string
>
en
<
/string
>
<
k
e
y
>
CFBundleDisplayName
<
/k
e
y
>
<
k
e
y
>
CFBundleDisplayName
<
/k
e
y
>
<
string
>
$
{
PRO
JE
CT_NAME
}<
/string
>
<
string
>
$
{
PRO
DU
CT_NAME
}<
/string
>
<
k
e
y
>
CFBundleExecutable
<
/k
e
y
>
<
k
e
y
>
CFBundleExecutable
<
/k
e
y
>
<
string
>
$
(
EXECUTABLE_NAME
)<
/string
>
<
string
>
$
(
EXECUTABLE_NAME
)<
/string
>
<
k
e
y
>
CFBundleIdentifier
<
/k
e
y
>
<
k
e
y
>
CFBundleIdentifier
<
/k
e
y
>
...
@@ -35,8 +35,17 @@
...
@@ -35,8 +35,17 @@
<
/
a
rr
a
y
>
<
/
a
rr
a
y
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
1
<
/string
>
<
string
>
1
<
/string
>
<
k
e
y
>
LSApplicationQueriesSchemes
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
weixin
<
/string
>
<
/
a
rr
a
y
>
<
k
e
y
>
LSRequiresIPhoneOS
<
/k
e
y
>
<
k
e
y
>
LSRequiresIPhoneOS
<
/k
e
y
>
<
tru
e
/
>
<
tru
e
/
>
<
k
e
y
>
NSAppTransportSecurity
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
NSAllowsArbitraryLoads
<
/k
e
y
>
<
tru
e
/
>
<
/
d
i
c
t
>
<
k
e
y
>
UILaunchStoryboardName
<
/k
e
y
>
<
k
e
y
>
UILaunchStoryboardName
<
/k
e
y
>
<
string
>
LaunchScreen
<
/string
>
<
string
>
LaunchScreen
<
/string
>
<
k
e
y
>
UIMainStoryboardFile
<
/k
e
y
>
<
k
e
y
>
UIMainStoryboardFile
<
/k
e
y
>
...
@@ -56,16 +65,5 @@
...
@@ -56,16 +65,5 @@
<
/
a
rr
a
y
>
<
/
a
rr
a
y
>
<
k
e
y
>
UIViewControllerBasedStatusBarAppearance
<
/k
e
y
>
<
k
e
y
>
UIViewControllerBasedStatusBarAppearance
<
/k
e
y
>
<
fa
ls
e
/
>
<
fa
ls
e
/
>
<
k
e
y
>
LSApplicationQueriesSchemes
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
weixin
<
/string
>
<
/
a
rr
a
y
>
<
k
e
y
>
NSAppTransportSecurity
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
NSAllowsArbitraryLoads
<
/k
e
y
>
<
tru
e
/
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/plist
>
<
/plist
>
ios/Classes/FluwxPlugin.m
浏览文件 @
d603a5fb
...
@@ -69,7 +69,7 @@ BOOL isWeChatRegistered = NO;
...
@@ -69,7 +69,7 @@ BOOL isWeChatRegistered = NO;
return
;
return
;
}
}
NSString
*
appId
=
call
.
arguments
[
appId
];
NSString
*
appId
=
call
.
arguments
[
@"appId"
];
if
([
StringUtil
isBlank
:
appId
])
{
if
([
StringUtil
isBlank
:
appId
])
{
result
([
FlutterError
errorWithCode
:
@"invalid app id"
message
:
@"are you sure your app id is correct ? "
details
:
appId
]);
result
([
FlutterError
errorWithCode
:
@"invalid app id"
message
:
@"are you sure your app id is correct ? "
details
:
appId
]);
return
;
return
;
...
...
ios/Classes/handler/FluwxShareHandler.m
浏览文件 @
d603a5fb
差异被折叠。
点击展开。
ios/Classes/wechat/WXApiRequestHandler.h
浏览文件 @
d603a5fb
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
#import "WXApiObject.h"
#import "WXApiObject.h"
#import "StringUtil.h"
@interface
WXApiRequestHandler
:
NSObject
@interface
WXApiRequestHandler
:
NSObject
...
@@ -26,19 +27,30 @@
...
@@ -26,19 +27,30 @@
Title
:(
NSString
*
)
title
Title
:(
NSString
*
)
title
Description
:(
NSString
*
)
description
Description
:(
NSString
*
)
description
ThumbImage
:(
UIImage
*
)
thumbImage
ThumbImage
:(
UIImage
*
)
thumbImage
MessageExt
:(
NSString
*
)
messageExt
MessageAction
:(
NSString
*
)
messageAction
InScene
:(
enum
WXScene
)
scene
;
InScene
:(
enum
WXScene
)
scene
;
+
(
BOOL
)
sendMusicURL
:(
NSString
*
)
musicURL
+
(
BOOL
)
sendMusicURL
:(
NSString
*
)
musicURL
dataURL
:(
NSString
*
)
dataURL
dataURL
:(
NSString
*
)
dataURL
MusicLowBandUrl
:(
NSString
*
)
musicLowBandUrl
MusicLowBandDataUrl
:(
NSString
*
)
musicLowBandDataUrl
Title
:(
NSString
*
)
title
Title
:(
NSString
*
)
title
Description
:(
NSString
*
)
description
Description
:(
NSString
*
)
description
ThumbImage
:(
UIImage
*
)
thumbImage
ThumbImage
:(
UIImage
*
)
thumbImage
MessageExt
:(
NSString
*
)
messageExt
MessageAction
:(
NSString
*
)
messageAction
TagName
:(
NSString
*
)
tagName
InScene
:(
enum
WXScene
)
scene
;
InScene
:(
enum
WXScene
)
scene
;
+
(
BOOL
)
sendVideoURL
:(
NSString
*
)
videoURL
+
(
BOOL
)
sendVideoURL
:(
NSString
*
)
videoURL
VideoLowBandUrl
:(
NSString
*
)
videoLowBandUrl
Title
:(
NSString
*
)
title
Title
:(
NSString
*
)
title
Description
:(
NSString
*
)
description
Description
:(
NSString
*
)
description
ThumbImage
:(
UIImage
*
)
thumbImage
ThumbImage
:(
UIImage
*
)
thumbImage
MessageExt
:(
NSString
*
)
messageExt
MessageAction
:(
NSString
*
)
messageAction
TagName
:(
NSString
*
)
tagName
InScene
:(
enum
WXScene
)
scene
;
InScene
:(
enum
WXScene
)
scene
;
+
(
BOOL
)
sendEmotionData
:(
NSData
*
)
emotionData
+
(
BOOL
)
sendEmotionData
:(
NSData
*
)
emotionData
...
@@ -61,6 +73,9 @@
...
@@ -61,6 +73,9 @@
hdImageData
:(
NSData
*
)
hdImageData
hdImageData
:(
NSData
*
)
hdImageData
withShareTicket
:(
BOOL
)
withShareTicket
withShareTicket
:(
BOOL
)
withShareTicket
miniProgramType
:(
WXMiniProgramType
)
programType
miniProgramType
:(
WXMiniProgramType
)
programType
MessageExt
:(
NSString
*
)
messageExt
MessageAction
:(
NSString
*
)
messageAction
TagName
:(
NSString
*
)
tagName
InScene
:(
enum
WXScene
)
scene
;
InScene
:(
enum
WXScene
)
scene
;
+
(
BOOL
)
launchMiniProgramWithUserName
:(
NSString
*
)
userName
+
(
BOOL
)
launchMiniProgramWithUserName
:(
NSString
*
)
userName
...
...
ios/Classes/wechat/WXApiRequestHandler.m
浏览文件 @
d603a5fb
差异被折叠。
点击展开。
lib/src/models/wechat_share_models.dart
浏览文件 @
d603a5fb
...
@@ -76,6 +76,11 @@ class WeChatShareMiniProgramModel extends WeChatShareModel {
...
@@ -76,6 +76,11 @@ class WeChatShareMiniProgramModel extends WeChatShareModel {
final
String
thumbnail
;
final
String
thumbnail
;
final
String
hdImagePath
;
final
bool
withShareTicket
;
///[hdImagePath] only works on iOS.
WeChatShareMiniProgramModel
(
WeChatShareMiniProgramModel
(
{
@required
this
.
webPageUrl
,
{
@required
this
.
webPageUrl
,
int
miniProgramType
,
int
miniProgramType
,
...
@@ -84,6 +89,8 @@ class WeChatShareMiniProgramModel extends WeChatShareModel {
...
@@ -84,6 +89,8 @@ class WeChatShareMiniProgramModel extends WeChatShareModel {
this
.
title
,
this
.
title
,
this
.
description
,
this
.
description
,
this
.
thumbnail
,
this
.
thumbnail
,
this
.
withShareTicket
:
false
,
this
.
hdImagePath
,
String
transaction
,
String
transaction
,
WeChatScene
scene
,
WeChatScene
scene
,
String
messageExt
,
String
messageExt
,
...
@@ -112,7 +119,9 @@ class WeChatShareMiniProgramModel extends WeChatShareModel {
...
@@ -112,7 +119,9 @@ class WeChatShareMiniProgramModel extends WeChatShareModel {
"description"
:
description
,
"description"
:
description
,
_transaction:
transaction
,
_transaction:
transaction
,
_scene:
scene
.
toString
(),
_scene:
scene
.
toString
(),
_thumbnail:
thumbnail
_thumbnail:
thumbnail
,
"withShareTicket"
:
withShareTicket
,
"hdImagePath"
:
hdImagePath
};
};
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论