Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-fluwx
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
openSourceLibrary
clx-fluwx
Commits
219d73eb
Unverified
提交
219d73eb
authored
5月 23, 2019
作者:
JarvanMo
提交者:
GitHub
5月 23, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #63 from read0nly/master
sign auto-deduct
上级
732dfa1b
e328c3bf
显示空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
432 行增加
和
14 行删除
+432
-14
README.md
README.md
+2
-1
README_CN.md
README_CN.md
+2
-2
FluwxPlugin.kt
android/src/main/kotlin/com/jarvan/fluwx/FluwxPlugin.kt
+6
-0
WeChatPluginMethods.java
...kotlin/com/jarvan/fluwx/constant/WeChatPluginMethods.java
+2
-0
FluwxAutoDeductHandler.kt
...kotlin/com/jarvan/fluwx/handler/FluwxAutoDeductHandler.kt
+45
-0
AUTO_DEDUCT.md
doc/AUTO_DEDUCT.md
+18
-0
AUTO_DEDUCT_CN.md
doc/AUTO_DEDUCT_CN.md
+18
-0
Podfile.lock
example/ios/Podfile.lock
+3
-3
project.pbxproj
example/ios/Runner.xcodeproj/project.pbxproj
+5
-5
main.dart
example/lib/main.dart
+14
-3
sign_auto_deduct_page.dart
example/lib/sign_auto_deduct_page.dart
+111
-0
FluwxPlugin.m
ios/Classes/FluwxPlugin.m
+7
-0
FluwxAutoDeductHandler.m
ios/Classes/handler/FluwxAutoDeductHandler.m
+55
-0
FluwxAutoDeductHandler.h
ios/Classes/public/FluwxAutoDeductHandler.h
+18
-0
WXApiObject.h
ios/Classes/public/WXApiObject.h
+0
-0
README.txt
ios/README.txt
+98
-0
libWeChatSDK.a
ios/libWeChatSDK.a
+0
-0
fluwx_iml.dart
lib/src/fluwx_iml.dart
+28
-0
没有找到文件。
README.md
浏览文件 @
219d73eb
...
@@ -23,6 +23,7 @@ QQ Group:892398530。
...
@@ -23,6 +23,7 @@ QQ Group:892398530。
*
Launch Mini-Program.
*
Launch Mini-Program.
*
Subscribe Message.
*
Subscribe Message.
*
Auth By QRCode
*
Auth By QRCode
*
Sign Auto-Deduct
## Sample
## Sample
...
@@ -71,7 +72,7 @@ Before using`Fluwx`,you should init `FLuwx`:
...
@@ -71,7 +72,7 @@ Before using`Fluwx`,you should init `FLuwx`:
*
[
Subscribe Message
](
./doc/SUBSCRIBE_MESSAGE.md
)
*
[
Subscribe Message
](
./doc/SUBSCRIBE_MESSAGE.md
)
*
[
Response
](
./doc/RESPONSE.md
)
*
[
Response
](
./doc/RESPONSE.md
)
*
[
Auth By QRCode
](
./doc/AUTH_BY_QR_CODE.md
)
*
[
Auth By QRCode
](
./doc/AUTH_BY_QR_CODE.md
)
*
[
Sign Auto-Deduct
](
./doc/AUTO_DEDUCT.md
)
### Other
### Other
*
[
Using Swift?
](
./doc/USING_SWIFT.md
)
*
[
Using Swift?
](
./doc/USING_SWIFT.md
)
*
[
Having Questions?
](
./doc/QUESTIONS.md
)
*
[
Having Questions?
](
./doc/QUESTIONS.md
)
...
...
README_CN.md
浏览文件 @
219d73eb
...
@@ -22,7 +22,7 @@ QQ群:892398530。
...
@@ -22,7 +22,7 @@ QQ群:892398530。
*
打开小程序。
*
打开小程序。
*
一次性订阅消息。
*
一次性订阅消息。
*
二维码登录。
*
二维码登录。
*
签约免密支付。
## 示例
## 示例
...
@@ -69,7 +69,7 @@ dependencies:
...
@@ -69,7 +69,7 @@ dependencies:
*
[
一次性订阅消息
](
./doc/SUBSCRIBE_MESSAGE_CN.md
)
。
*
[
一次性订阅消息
](
./doc/SUBSCRIBE_MESSAGE_CN.md
)
。
*
[
微信回调
](
./doc/RESPONSE_CN.md
)
。
*
[
微信回调
](
./doc/RESPONSE_CN.md
)
。
*
[
二维码登录
](
./doc/AUTH_BY_QR_CODE_CN.md
)
。
*
[
二维码登录
](
./doc/AUTH_BY_QR_CODE_CN.md
)
。
*
[
签约免密支付
](
./doc/AUTO_DEDUCT_CN.md
)
。
### Q&A
### Q&A
请先看文档,再看Q&A,再查看issue,自我排查错误,方便你我他。依然无法解决的问题可以加群提问。
请先看文档,再看Q&A,再查看issue,自我排查错误,方便你我他。依然无法解决的问题可以加群提问。
...
...
android/src/main/kotlin/com/jarvan/fluwx/FluwxPlugin.kt
浏览文件 @
219d73eb
...
@@ -40,6 +40,7 @@ class FluwxPlugin(private val registrar: Registrar, channel: MethodChannel) : Me
...
@@ -40,6 +40,7 @@ class FluwxPlugin(private val registrar: Registrar, channel: MethodChannel) : Me
private
val
fluwxPayHandler
=
FluwxPayHandler
()
private
val
fluwxPayHandler
=
FluwxPayHandler
()
private
val
fluwxLaunchMiniProgramHandler
=
FluwxLaunchMiniProgramHandler
()
private
val
fluwxLaunchMiniProgramHandler
=
FluwxLaunchMiniProgramHandler
()
private
val
fluwxSubscribeMsgHandler
=
FluwxSubscribeMsgHandler
()
private
val
fluwxSubscribeMsgHandler
=
FluwxSubscribeMsgHandler
()
private
val
fluwxAutodeducthandler
=
FluwxAutoDeductHandler
()
init
{
init
{
fluwxShareHandler
.
setRegistrar
(
registrar
)
fluwxShareHandler
.
setRegistrar
(
registrar
)
...
@@ -98,6 +99,11 @@ class FluwxPlugin(private val registrar: Registrar, channel: MethodChannel) : Me
...
@@ -98,6 +99,11 @@ class FluwxPlugin(private val registrar: Registrar, channel: MethodChannel) : Me
return
return
}
}
if
(
WeChatPluginMethods
.
AUTO_DEDUCT
==
call
.
method
)
{
fluwxAutodeducthandler
.
signAutoDeduct
(
call
,
result
)
return
}
if
(
call
.
method
.
startsWith
(
"share"
))
{
if
(
call
.
method
.
startsWith
(
"share"
))
{
fluwxShareHandler
.
handle
(
call
,
result
)
fluwxShareHandler
.
handle
(
call
,
result
)
}
else
{
}
else
{
...
...
android/src/main/kotlin/com/jarvan/fluwx/constant/WeChatPluginMethods.java
浏览文件 @
219d73eb
...
@@ -26,4 +26,6 @@ public class WeChatPluginMethods {
...
@@ -26,4 +26,6 @@ public class WeChatPluginMethods {
public
static
final
String
WE_CHAT_PAY_RESPONSE
=
"onPayResponse"
;
public
static
final
String
WE_CHAT_PAY_RESPONSE
=
"onPayResponse"
;
public
static
final
String
SUBSCRIBE_MSG
=
"subscribeMsg"
;
public
static
final
String
SUBSCRIBE_MSG
=
"subscribeMsg"
;
public
static
final
String
AUTO_DEDUCT
=
"autoDeduct"
;
}
}
android/src/main/kotlin/com/jarvan/fluwx/handler/FluwxAutoDeductHandler.kt
0 → 100644
浏览文件 @
219d73eb
package
com.jarvan.fluwx.handler
import
com.tencent.mm.opensdk.modelbiz.WXOpenBusinessWebview
import
io.flutter.plugin.common.MethodCall
import
io.flutter.plugin.common.MethodChannel
import
java.util.HashMap
class
FluwxAutoDeductHandler
{
fun
signAutoDeduct
(
call
:
MethodCall
,
result
:
MethodChannel
.
Result
)
{
val
appId
:
String
=
call
.
argument
<
String
>(
"appid"
)
?:
""
val
mchId
=
call
.
argument
<
String
>(
"mch_id"
)
?:
""
val
planId
=
call
.
argument
<
String
>(
"plan_id"
)
?:
""
val
contractCode
=
call
.
argument
<
String
>(
"contract_code"
)
?:
""
val
requestSerial
=
call
.
argument
<
String
>(
"request_serial"
)
?:
""
val
contractDisplayAccount
=
call
.
argument
<
String
>(
"contract_display_account"
)
?:
""
val
notifyUrl
=
call
.
argument
<
String
>(
"notify_url"
)
?:
""
val
version
=
call
.
argument
<
String
>(
"version"
)
?:
""
val
sign
=
call
.
argument
<
String
>(
"sign"
)
?:
""
val
timestamp
=
call
.
argument
<
String
>(
"timestamp"
)
?:
""
val
returnApp
=
call
.
argument
<
String
>(
"return_app"
)
?:
""
val
map
=
HashMap
<
String
,
String
>()
map
.
put
(
"appid"
,
appId
)
map
.
put
(
"mch_id"
,
mchId
)
map
.
put
(
"plan_id"
,
planId
)
map
.
put
(
"contract_code"
,
contractCode
)
map
.
put
(
"request_serial"
,
requestSerial
)
map
.
put
(
"contract_display_account"
,
contractDisplayAccount
)
map
.
put
(
"notify_url"
,
notifyUrl
)
map
.
put
(
"version"
,
version
)
map
.
put
(
"sign"
,
sign
)
map
.
put
(
"timestamp"
,
timestamp
)
map
.
put
(
"return_app"
,
returnApp
)
val
req
=
WXOpenBusinessWebview
.
Req
()
req
.
businessType
=
12
req
.
queryInfo
=
map
val
b
=
WXAPiHandler
.
wxApi
?.
sendReq
(
req
)
result
.
success
(
b
)
}
}
\ No newline at end of file
doc/AUTO_DEDUCT.md
0 → 100644
浏览文件 @
219d73eb
## SIGN AUTO-DEDUCT
see
[
details
](
https://pay.weixin.qq.com/wiki/doc/api/pap.php?chapter=18_5&index=2
)
.
```
dart
import
'package:fluwx/fluwx.dart'
as
fluwx
;
fluwx
.
autoDeDuct
(
appId:
""
,
mchId:
""
,
planId:
""
,
contractCode:
""
,
requestSerial:
""
,
contractDisplayAccount:
""
,
notifyUrl:
""
,
version:
""
,
sign:
""
,
timestamp:
""
,
returnApp:
'3'
);
```
\ No newline at end of file
doc/AUTO_DEDUCT_CN.md
0 → 100644
浏览文件 @
219d73eb
## 签约微信免密支付
查看
[
详情
](
https://pay.weixin.qq.com/wiki/doc/api/pap.php?chapter=18_5&index=2
)
.
```
dart
import
'package:fluwx/fluwx.dart'
as
fluwx
;
fluwx
.
autoDeDuct
(
appId:
""
,
mchId:
""
,
planId:
""
,
contractCode:
""
,
requestSerial:
""
,
contractDisplayAccount:
""
,
notifyUrl:
""
,
version:
""
,
sign:
""
,
timestamp:
""
,
returnApp:
'3'
);
```
\ No newline at end of file
example/ios/Podfile.lock
浏览文件 @
219d73eb
...
@@ -14,9 +14,9 @@ EXTERNAL SOURCES:
...
@@ -14,9 +14,9 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/fluwx/ios"
:path: ".symlinks/plugins/fluwx/ios"
SPEC CHECKSUMS:
SPEC CHECKSUMS:
Flutter:
58dd7d1b27887414a370fcccb9e645c08ffd7a6a
Flutter:
9d0fac939486c9aba2809b7982dfdbb47a7b0296
fluwx:
19524c5e4c9c539a646407259139c9c1e4eaf9e5
fluwx:
9cbb1181ef8fd772f7388714ec9b5dfd3a5d0108
PODFILE CHECKSUM: 348e15598a1c6ea25d3ed63919d5ffb9bd1c2ba6
PODFILE CHECKSUM: 348e15598a1c6ea25d3ed63919d5ffb9bd1c2ba6
COCOAPODS: 1.
6.1
COCOAPODS: 1.
5.3
example/ios/Runner.xcodeproj/project.pbxproj
浏览文件 @
219d73eb
...
@@ -183,7 +183,6 @@
...
@@ -183,7 +183,6 @@
TargetAttributes
=
{
TargetAttributes
=
{
97C146ED1CF9000F007C117D
=
{
97C146ED1CF9000F007C117D
=
{
CreatedOnToolsVersion
=
7.3.1
;
CreatedOnToolsVersion
=
7.3.1
;
DevelopmentTeam
=
8JJXUFV6F7
;
SystemCapabilities
=
{
SystemCapabilities
=
{
com.apple.BackgroundModes
=
{
com.apple.BackgroundModes
=
{
enabled
=
1
;
enabled
=
1
;
...
@@ -197,6 +196,7 @@
...
@@ -197,6 +196,7 @@
developmentRegion
=
English
;
developmentRegion
=
English
;
hasScannedForEncodings
=
0
;
hasScannedForEncodings
=
0
;
knownRegions
=
(
knownRegions
=
(
English
,
en
,
en
,
Base
,
Base
,
);
);
...
@@ -279,7 +279,7 @@
...
@@ -279,7 +279,7 @@
files
=
(
files
=
(
);
);
inputPaths
=
(
inputPaths
=
(
"${
PODS_ROOT}
/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh"
,
"${
SRCROOT}/Pods
/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh"
,
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework"
,
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework"
,
);
);
name
=
"[CP] Embed Pods Frameworks"
;
name
=
"[CP] Embed Pods Frameworks"
;
...
@@ -288,7 +288,7 @@
...
@@ -288,7 +288,7 @@
);
);
runOnlyForDeploymentPostprocessing
=
0
;
runOnlyForDeploymentPostprocessing
=
0
;
shellPath
=
/bin/sh
;
shellPath
=
/bin/sh
;
shellScript
=
"\"${
PODS_ROOT}
/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"
;
shellScript
=
"\"${
SRCROOT}/Pods
/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"
;
showEnvVarsInLog
=
0
;
showEnvVarsInLog
=
0
;
};
};
/* End PBXShellScriptBuildPhase section */
/* End PBXShellScriptBuildPhase section */
...
@@ -437,7 +437,7 @@
...
@@ -437,7 +437,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES
=
YES
;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES
=
YES
;
CURRENT_PROJECT_VERSION
=
1
;
CURRENT_PROJECT_VERSION
=
1
;
DEVELOPMENT_TEAM
=
8JJXUFV6F7
;
DEVELOPMENT_TEAM
=
""
;
ENABLE_BITCODE
=
NO
;
ENABLE_BITCODE
=
NO
;
FRAMEWORK_SEARCH_PATHS
=
(
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(inherited)"
,
...
@@ -465,7 +465,7 @@
...
@@ -465,7 +465,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES
=
YES
;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES
=
YES
;
CURRENT_PROJECT_VERSION
=
1
;
CURRENT_PROJECT_VERSION
=
1
;
DEVELOPMENT_TEAM
=
8JJXUFV6F7
;
DEVELOPMENT_TEAM
=
""
;
ENABLE_BITCODE
=
NO
;
ENABLE_BITCODE
=
NO
;
FRAMEWORK_SEARCH_PATHS
=
(
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(inherited)"
,
...
...
example/lib/main.dart
浏览文件 @
219d73eb
...
@@ -2,8 +2,9 @@ import 'dart:async';
...
@@ -2,8 +2,9 @@ import 'dart:async';
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:fluwx/fluwx.dart'
as
fluwx
;
import
'package:fluwx/fluwx.dart'
as
fluwx
;
import
'package:fluwx_example/launch_mini_program_page.dart'
;
import
'package:fluwx_example/subscribe_message_page.dart'
;
import
'launch_mini_program_page.dart'
;
import
'subscribe_message_page.dart'
;
import
'auth_by_qr_code_page.dart'
;
import
'auth_by_qr_code_page.dart'
;
import
'pay_page.dart'
;
import
'pay_page.dart'
;
...
@@ -14,6 +15,7 @@ import 'share_music.dart';
...
@@ -14,6 +15,7 @@ import 'share_music.dart';
import
'share_text_image.dart'
;
import
'share_text_image.dart'
;
import
'share_video_page.dart'
;
import
'share_video_page.dart'
;
import
'share_web_page.dart'
;
import
'share_web_page.dart'
;
import
'sign_auto_deduct_page.dart'
;
void
main
(
)
=>
runApp
(
new
MyApp
());
void
main
(
)
=>
runApp
(
new
MyApp
());
...
@@ -56,7 +58,8 @@ class _MyAppState extends State<MyApp> {
...
@@ -56,7 +58,8 @@ class _MyAppState extends State<MyApp> {
"pay"
:
(
context
)
=>
PayPage
(),
"pay"
:
(
context
)
=>
PayPage
(),
"launchMiniProgram"
:
(
context
)
=>
LaunchMiniProgramPage
(),
"launchMiniProgram"
:
(
context
)
=>
LaunchMiniProgramPage
(),
"subscribeMessage"
:
(
ctx
)
=>
SubscribeMessagePage
(),
"subscribeMessage"
:
(
ctx
)
=>
SubscribeMessagePage
(),
"AuthByQRCode"
:
(
ctx
)
=>
AuthByQRCodePage
()
"AuthByQRCode"
:
(
ctx
)
=>
AuthByQRCodePage
(),
'AutoDeduct'
:
(
ctx
)
=>
SignAutoDeductPage
(),
},
},
home:
new
Scaffold
(
home:
new
Scaffold
(
appBar:
new
AppBar
(
appBar:
new
AppBar
(
...
@@ -161,6 +164,14 @@ class ShareSelectorPage extends StatelessWidget {
...
@@ -161,6 +164,14 @@ class ShareSelectorPage extends StatelessWidget {
},
},
child:
const
Text
(
"AuthByQRCode"
)),
child:
const
Text
(
"AuthByQRCode"
)),
),
),
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
new
OutlineButton
(
onPressed:
()
{
Navigator
.
of
(
context
).
pushNamed
(
"AutoDeduct"
);
},
child:
const
Text
(
"SignAuto-deduct"
)),
),
],
],
),
),
);
);
...
...
example/lib/sign_auto_deduct_page.dart
0 → 100644
浏览文件 @
219d73eb
import
'package:flutter/material.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:fluwx/fluwx.dart'
as
fluwx
;
class
SignAutoDeductPage
extends
StatefulWidget
{
@override
_SignAutoDeductPageState
createState
()
=>
_SignAutoDeductPageState
();
}
/// see wechat [document](https://pay.weixin.qq.com/wiki/doc/api/pap.php?chapter=18_5&index=2)
class
_SignAutoDeductPageState
extends
State
<
SignAutoDeductPage
>
{
TextEditingController
appId
=
TextEditingController
(
text:
"wx316f9c82e99ac105"
);
TextEditingController
mchId
=
TextEditingController
(
text:
""
);
TextEditingController
planId
=
TextEditingController
(
text:
""
);
TextEditingController
contractCode
=
TextEditingController
(
text:
""
);
TextEditingController
requestSerial
=
TextEditingController
(
text:
""
);
TextEditingController
contractDisplayAccount
=
TextEditingController
(
text:
""
);
TextEditingController
notifyUrl
=
TextEditingController
(
text:
""
);
TextEditingController
version
=
TextEditingController
(
text:
"1.0"
);
TextEditingController
sign
=
TextEditingController
(
text:
""
);
TextEditingController
timestamp
=
TextEditingController
(
text:
""
);
TextEditingController
returnApp
=
TextEditingController
(
text:
"3"
);
@override
void
initState
()
{
super
.
initState
();
fluwx
.
responseFromSubscribeMsg
.
listen
((
resp
)
{
print
(
"resp =
$resp
"
);
});
}
@override
void
dispose
()
{
appId
.
dispose
();
mchId
.
dispose
();
planId
.
dispose
();
contractCode
.
dispose
();
contractDisplayAccount
.
dispose
();
requestSerial
.
dispose
();
notifyUrl
.
dispose
();
version
.
dispose
();
sign
.
dispose
();
timestamp
.
dispose
();
returnApp
.
dispose
();
super
.
dispose
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
Text
(
'SubscribeMessagePage'
),
),
body:
Container
(
child:
ListView
(
children:
<
Widget
>[
_buildTextField
(
title:
"appId"
,
textEditController:
appId
),
_buildTextField
(
title:
"mchId"
,
textEditController:
mchId
),
_buildTextField
(
title:
"planId"
,
textEditController:
planId
),
_buildTextField
(
title:
"contractCode"
,
textEditController:
contractCode
),
_buildTextField
(
title:
"requestSerial"
,
textEditController:
requestSerial
),
_buildTextField
(
title:
"contractDisplayAccount"
,
textEditController:
contractDisplayAccount
),
_buildTextField
(
title:
"notifyUrl"
,
textEditController:
notifyUrl
),
_buildTextField
(
title:
"version"
,
textEditController:
version
),
_buildTextField
(
title:
"sign"
,
textEditController:
sign
),
_buildTextField
(
title:
"timestamp"
,
textEditController:
timestamp
),
_buildTextField
(
title:
"returnApp"
,
textEditController:
returnApp
),
CupertinoButton
(
child:
Text
(
'request once sign auto-deduct message'
),
onPressed:
_signAutoDeduct
,
),
],
),
),
);
}
Widget
_buildTextField
({
String
title
,
TextEditingController
textEditController
,
})
{
return
TextField
(
decoration:
InputDecoration
(
labelText:
title
,
),
controller:
textEditController
,
);
}
void
_signAutoDeduct
()
{
fluwx
.
autoDeDuct
(
appId:
appId
.
text
??
""
,
mchId:
mchId
.
text
??
""
,
planId:
planId
.
text
??
""
,
contractCode:
contractCode
.
text
??
""
,
requestSerial:
requestSerial
.
text
??
""
,
contractDisplayAccount:
contractDisplayAccount
.
text
??
""
,
notifyUrl:
notifyUrl
.
text
??
""
,
version:
version
.
text
??
""
,
sign:
sign
.
text
??
""
,
timestamp:
timestamp
.
text
??
""
,
returnApp:
'3'
);
}
}
ios/Classes/FluwxPlugin.m
浏览文件 @
219d73eb
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
#import "FluwxShareHandler.h"
#import "FluwxShareHandler.h"
#import "FluwxLaunchMiniProgramHandler.h"
#import "FluwxLaunchMiniProgramHandler.h"
#import "FluwxSubscribeMsgHandler.h"
#import "FluwxSubscribeMsgHandler.h"
#import "FluwxAutoDeductHandler.h"
@implementation
FluwxPlugin
@implementation
FluwxPlugin
...
@@ -23,6 +24,7 @@ FluwxWXApiHandler *_fluwxWXApiHandler;
...
@@ -23,6 +24,7 @@ FluwxWXApiHandler *_fluwxWXApiHandler;
FluwxPaymentHandler
*
_fluwxPaymentHandler
;
FluwxPaymentHandler
*
_fluwxPaymentHandler
;
FluwxLaunchMiniProgramHandler
*
_fluwxLaunchMiniProgramHandler
;
FluwxLaunchMiniProgramHandler
*
_fluwxLaunchMiniProgramHandler
;
FluwxSubscribeMsgHandler
*
_fluwxSubscribeMsgHandler
;
FluwxSubscribeMsgHandler
*
_fluwxSubscribeMsgHandler
;
FluwxAutoDeductHandler
*
_fluwxAutoDeductHandler
;
-
(
void
)
dealloc
-
(
void
)
dealloc
{
{
...
@@ -54,6 +56,7 @@ FluwxSubscribeMsgHandler *_fluwxSubscribeMsgHandler;
...
@@ -54,6 +56,7 @@ FluwxSubscribeMsgHandler *_fluwxSubscribeMsgHandler;
_fluwxPaymentHandler
=
[[
FluwxPaymentHandler
alloc
]
initWithRegistrar
:
registrar
];
_fluwxPaymentHandler
=
[[
FluwxPaymentHandler
alloc
]
initWithRegistrar
:
registrar
];
_fluwxLaunchMiniProgramHandler
=
[[
FluwxLaunchMiniProgramHandler
alloc
]
initWithRegistrar
:
registrar
];
_fluwxLaunchMiniProgramHandler
=
[[
FluwxLaunchMiniProgramHandler
alloc
]
initWithRegistrar
:
registrar
];
_fluwxSubscribeMsgHandler
=
[[
FluwxSubscribeMsgHandler
alloc
]
initWithRegistrar
:
registrar
];
_fluwxSubscribeMsgHandler
=
[[
FluwxSubscribeMsgHandler
alloc
]
initWithRegistrar
:
registrar
];
_fluwxAutoDeductHandler
=
[[
FluwxAutoDeductHandler
alloc
]
initWithRegistrar
:
registrar
];
}
}
return
self
;
return
self
;
...
@@ -105,6 +108,10 @@ FluwxSubscribeMsgHandler *_fluwxSubscribeMsgHandler;
...
@@ -105,6 +108,10 @@ FluwxSubscribeMsgHandler *_fluwxSubscribeMsgHandler;
[
_fluwxAuthHandler
stopAuthByQRCode
:
call
result
:
result
];
[
_fluwxAuthHandler
stopAuthByQRCode
:
call
result
:
result
];
return
;
return
;
}
}
if
([
@"autoDeduct"
isEqualToString
:
call
.
method
]){
[
_fluwxAutoDeductHandler
handleAutoDeductWithCall
:
call
result
:
result
];
return
;
}
if
([
call
.
method
hasPrefix
:
@"share"
])
{
if
([
call
.
method
hasPrefix
:
@"share"
])
{
[
_fluwxShareHandler
handleShare
:
call
result
:
result
];
[
_fluwxShareHandler
handleShare
:
call
result
:
result
];
...
...
ios/Classes/handler/FluwxAutoDeductHandler.m
0 → 100644
浏览文件 @
219d73eb
//
// FluwxAutoDeductHandler.m
// fluwx
//
// Created by realm on 2019/5/22.
//
#import "FluwxAutoDeductHandler.h"
#import <WXApiRequestHandler.h>
@implementation
FluwxAutoDeductHandler
{
NSObject
<
FlutterPluginRegistrar
>
*
_registrar
;
}
-
(
instancetype
)
initWithRegistrar
:
(
NSObject
<
FlutterPluginRegistrar
>
*
)
registrar
{
self
=
[
super
init
];
if
(
self
)
{
_registrar
=
registrar
;
}
return
self
;
}
-
(
void
)
handleAutoDeductWithCall
:
(
FlutterMethodCall
*
)
call
result
:
(
FlutterResult
)
result
{
NSDictionary
*
params
=
call
.
arguments
;
WXOpenBusinessWebViewReq
*
req
=
[[
WXOpenBusinessWebViewReq
alloc
]
init
];
req
.
businessType
=
12
;
req
.
queryInfoDic
=
params
;
BOOL
b
=
[
WXApi
sendReq
:
req
];
result
(
@
(
b
));
}
-
(
NSString
*
)
convertToJsonData
:
(
NSDictionary
*
)
dict
{
NSError
*
error
;
NSData
*
jsonData
=
[
NSJSONSerialization
dataWithJSONObject
:
dict
options
:
NSJSONWritingPrettyPrinted
error
:&
error
];
NSString
*
jsonString
;
if
(
!
jsonData
)
{
NSLog
(
@"%@"
,
error
);
}
else
{
jsonString
=
[[
NSString
alloc
]
initWithData
:
jsonData
encoding
:
NSUTF8StringEncoding
];
}
NSMutableString
*
mutStr
=
[
NSMutableString
stringWithString
:
jsonString
];
// NSRange range = {0,jsonString.length};
// //去掉字符串中的空格
// [mutStr replaceOccurrencesOfString:@" " withString:@"" options:NSLiteralSearch range:range];
NSRange
range2
=
{
0
,
mutStr
.
length
};
//去掉字符串中的换行符
[
mutStr
replaceOccurrencesOfString
:
@"
\n
"
withString
:
@""
options
:
NSLiteralSearch
range
:
range2
];
return
mutStr
;
}
@end
ios/Classes/public/FluwxAutoDeductHandler.h
0 → 100644
浏览文件 @
219d73eb
//
// FluwxAutoDeductHandler.h
// fluwx
//
// Created by realm on 2019/5/22.
//
#import <Foundation/Foundation.h>
#import <Flutter/Flutter.h>
NS_ASSUME_NONNULL_BEGIN
@interface
FluwxAutoDeductHandler
:
NSObject
-
(
instancetype
)
initWithRegistrar
:(
NSObject
<
FlutterPluginRegistrar
>
*
)
registrar
;
-
(
void
)
handleAutoDeductWithCall
:(
FlutterMethodCall
*
)
call
result
:(
FlutterResult
)
result
;
@end
NS_ASSUME_NONNULL_END
ios/Classes/public/WXApiObject.h
浏览文件 @
219d73eb
ios/README.txt
0 → 100644
浏览文件 @
219d73eb
重要!
SDK1.8.4
1. 调整分享图片大小限制
2. 新增openBusinessView接口
SDK1.8.3
1. SDK增加调起微信刷卡支付接口
2. SDK增加小程序订阅消息接口
3. 修复小程序订阅消息接口没有resp的问题
SDK1.8.2
1. SDK增加开发票授权 WXInvoiceAuthInsert
2. SDK增加非税接口 WXNontaxPay
3. SDK增加医保接口 WXPayInsurance
4. 更换MTA库
SDK1.8.1
1. SDK打开小程序支持指定版本(体验,开发,正式版)
2. SDK分享小程序支持指定版本(体验,开发,正式版)
3. SDK支持输出log日志
SDK1.8.0
1. SDK支持打开小程序
2. SDK分享小程序支持shareTicket
SDK1.7.9
1. SDK订阅一次性消息
SDK1.7.8
1 SDK分享小程序支持大图
SDK1.7.7
1 增加SDK分享小程序
2 增加选择发票接口
SDK1.7.6
1. 提高稳定性
1 修复mta崩溃
2 新增接口支持开发者关闭mta数据统计上报
SDK1.7.5
1. 提高稳定性
2. 加快registerApp接口启动速度
SDK1.7.4
1. 更新支持iOS启用 ATS(App Transport Security)
2. 需要在工程中链接CFNetwork.framework
3. 在工程配置中的”Other Linker Flags”中加入”-Objc -all_load”
SDK1.7.3
1. 增强稳定性,适配iOS10
2. 修复小于32K的jpg格式缩略图设置失败的问题
SDK1.7.2
1. 修复因CTTeleponyNetworkInfo引起的崩溃问题
SDK1.7.1
1. 支持兼容ipv6(提升稳定性)
2. xCode Version 7.3.1 (7D1014) 编译
SDK1.7
1. 支持兼容ipv6
2. 修复若干问题增强稳定性
SDK1.6.3
1. xCode7.2 构建的sdk包。
2. 请使用xCode7.2进行编译。
3. 需要在Build Phases中Link Security.framework
4. 修复若干小问题。
SDK1.6.2
1、xCode7.1 构建的sdk包
2、请使用xCode7.1进行编译
SDK1.6.1
1、修复armv7s下,bitcode可能编译不过
2、解决warning
SDK1.6
1、iOS 9系统策略更新,限制了http协议的访问,此外应用需要在“Info.plist”中将要使用的URL Schemes列为白名单,才可正常检查其他应用是否安装。
受此影响,当你的应用在iOS 9中需要使用微信SDK的相关能力(分享、收藏、支付、登录等)时,需要在“Info.plist”里增加如下代码:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixin</string>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
2、开发者需要在工程中链接上 CoreTelephony.framework
3、解决bitcode编译不过问题
SDK1.5
1、废弃safeSendReq:接口,使用sendReq:即可。
2、新增+(BOOL) sendAuthReq:(SendAuthReq*) req viewController : (UIViewController*) viewController delegate:(id<WXApiDelegate>) delegate;
支持未安装微信情况下Auth,具体见WXApi.h接口描述
3、微信开放平台新增了微信模块用户统计功能,便于开发者统计微信功能模块的用户使用和活跃情况。开发者需要在工程中链接上:SystemConfiguration.framework,libz.dylib,libsqlite3.0.dylib。
ios/
Lib/
libWeChatSDK.a
→
ios/libWeChatSDK.a
浏览文件 @
219d73eb
File moved
lib/src/fluwx_iml.dart
浏览文件 @
219d73eb
...
@@ -301,6 +301,34 @@ Future subscribeMsg({
...
@@ -301,6 +301,34 @@ Future subscribeMsg({
);
);
}
}
Future
autoDeDuct
(
{
@required
String
appId
,
@required
String
mchId
,
@required
String
planId
,
@required
String
contractCode
,
@required
String
requestSerial
,
@required
String
contractDisplayAccount
,
@required
String
notifyUrl
,
@required
String
version
,
@required
String
sign
,
@required
String
timestamp
,
String
returnApp
=
'3'
,
})
async
{
return
await
_channel
.
invokeMethod
(
"autoDeduct"
,
{
'appid'
:
appId
,
'mch_id'
:
mchId
,
'plan_id'
:
planId
,
'contract_code'
:
contractCode
,
'request_serial'
:
requestSerial
,
'contract_display_account'
:
contractDisplayAccount
,
'notify_url'
:
notifyUrl
,
'version'
:
version
,
'sign'
:
sign
,
'timestamp'
:
timestamp
,
'return_app'
:
returnApp
,
});
}
_handleOnAuthByQRCodeFinished
(
MethodCall
methodCall
)
{
_handleOnAuthByQRCodeFinished
(
MethodCall
methodCall
)
{
int
errCode
=
methodCall
.
arguments
[
"errCode"
];
int
errCode
=
methodCall
.
arguments
[
"errCode"
];
_authByQRCodeFinishedController
.
add
(
AuthByQRCodeResult
(
_authByQRCodeFinishedController
.
add
(
AuthByQRCodeResult
(
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论