Compare commits

...

8 Commits

Author SHA1 Message Date
little-snow-fox
ceb4cb20ee update version 2020-11-30 11:36:01 +08:00
little-snow-fox
a082ab6003 update version 2020-11-30 11:22:33 +08:00
little-snow-fox
aa3960a371 update version 2020-11-30 11:16:41 +08:00
little-snow-fox
e3c92c575f 修复 pod install 报错 2020-08-30 14:51:23 +08:00
little-snow-fox
48ca61a06b update version. 2020-08-13 11:21:22 +08:00
little-snow-fox
62916e8c4a feat 修复 miniProgramType 大小写导致参数失效的问题 2020-07-30 08:52:53 +08:00
little-snow-fox
c3209151a1 fix 修复多余调用代码导致的报错 2020-06-19 14:39:53 +08:00
little-snow-fox
23fb934cf0 修改 SDK. 2020-06-19 09:15:45 +08:00
19 changed files with 317 additions and 126 deletions

View File

@ -6,12 +6,15 @@
# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
#
require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
Pod::Spec.new do |s|
s.name = "RCTWeChat"
s.version = "1.9.12"
s.summary = "React-Native(iOS/Android) functionalities include WeChat Login, Share, Favorite and Payment {QQ: 336021910}"
s.version = package['version']
s.summary = "React-Native(iOS/Android) functionalities include WeChat Login, Share, Favorite and Payment"
s.description = <<-DESC
React-Native(iOS/Android) functionalities include WeChat Login, Share, Favorite and Payment {QQ: 336021910}
React-Native(iOS/Android) functionalities include WeChat Login, Share, Favorite and Payment
DESC
s.author = { "little-snow-fox" => "fox@sfxh.cc" }
s.homepage = "https://github.com/little-snow-fox/react-native-wechat-lib"
@ -19,9 +22,9 @@ Pod::Spec.new do |s|
s.platform = :ios, "9.0"
s.source = { :git => "https://github.com/little-snow-fox/react-native-wechat-lib.git", :tag => "master" }
s.source_files = "ios/*.{h,m}"
s.dependency "React"
s.dependency "React-Core"
s.vendored_libraries = "ios/libWeChatSDK.a"
s.requires_arc = true
s.frameworks = 'SystemConfiguration','CoreTelephony'
s.frameworks = 'SystemConfiguration','CoreTelephony','WebKit'
s.library = 'sqlite3','c++','z'
end

Binary file not shown.

Binary file not shown.

View File

View File

116
android/.idea/codeStyles/Project.xml generated Normal file
View File

@ -0,0 +1,116 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<codeStyleSettings language="XML">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
</code_scheme>
</component>

13
android/.idea/gradle.xml generated Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="resolveModulePerSourceSet" value="false" />
<option name="testRunner" value="PLATFORM" />
</GradleProjectSettings>
</option>
</component>
</project>

9
android/.idea/misc.xml generated Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

8
android/.idea/modules.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/android.iml" filepath="$PROJECT_DIR$/android.iml" />
</modules>
</component>
</project>

12
android/.idea/runConfigurations.xml generated Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>

6
android/.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

109
android/.idea/workspace.xml generated Normal file
View File

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="c18cd637-5909-4260-9933-9ba4f05684da" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/../package.json" beforeDir="false" afterPath="$PROJECT_DIR$/../package.json" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="DefaultGradleProjectSettings">
<option name="testRunner" value="GRADLE" />
<option name="delegatedBuild" value="true" />
</component>
<component name="ExternalProjectsManager">
<system id="GRADLE">
<state>
<projects_view />
</state>
</system>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
</component>
<component name="ProjectConfigurationFiles">
<option name="files">
<list>
<option value="$PROJECT_DIR$/.idea/vcs.xml" />
</list>
</option>
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="87" />
<option name="y" value="52" />
<option name="width" value="1687" />
<option name="height" value="958" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="PackagesPane" />
<pane id="AndroidView" />
<pane id="Scope" />
<pane id="ProjectPane" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="android.sdk.path" value="$USER_HOME$/Library/Android/sdk" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
<property name="show.migrate.to.gradle.popup" value="false" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="c18cd637-5909-4260-9933-9ba4f05684da" name="Default Changelist" comment="" />
<created>1605511675904</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1605511675904</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="0" y="23" width="2560" height="1343" extended-state="6" />
<layout>
<window_info id="Captures" order="0" weight="0.25" />
<window_info active="true" content_ui="combo" id="Project" order="1" visible="true" weight="0.33200952" />
<window_info id="Structure" order="2" side_tool="true" />
<window_info id="Build Variants" order="3" side_tool="true" />
<window_info id="Image Layers" order="4" />
<window_info id="Designer" order="5" />
<window_info id="Capture Tool" order="6" />
<window_info id="Resources Explorer" order="7" />
<window_info id="Favorites" order="8" side_tool="true" />
<window_info anchor="bottom" id="Version Control" order="0" />
<window_info anchor="bottom" id="TODO" order="1" />
<window_info anchor="bottom" id="Terminal" order="2" />
<window_info anchor="bottom" id="Event Log" order="3" side_tool="true" />
<window_info anchor="bottom" id="Build" order="4" visible="true" weight="0.32960895" />
<window_info anchor="right" id="Flutter Inspector" />
<window_info anchor="right" id="Flutter Outline" />
<window_info anchor="right" id="Flutter Performance" />
<window_info anchor="right" id="Capture Analysis" order="0" />
<window_info anchor="right" id="Gradle" order="1" />
<window_info anchor="right" id="Theme Preview" order="2" />
<window_info anchor="right" id="Palette&#9;" order="3" />
</layout>
</component>
</project>

View File

@ -458,7 +458,7 @@ public class WeChatModule extends ReactContextBaseJavaModule implements IWXAPIEv
// 兼容低版本的网页链接
miniProgramObj.webpageUrl = data.hasKey("webpageUrl") ? data.getString("webpageUrl") : null;
// 正式版:0测试版:1体验版:2
miniProgramObj.miniprogramType = data.hasKey("miniprogramType") ? data.getInt("miniprogramType") : WXMiniProgramObject.MINIPTOGRAM_TYPE_RELEASE;
miniProgramObj.miniprogramType = data.hasKey("miniProgramType") ? data.getInt("miniProgramType") : WXMiniProgramObject.MINIPTOGRAM_TYPE_RELEASE;
// 小程序原始id
miniProgramObj.userName = data.hasKey("userName") ? data.getString("userName") : null;
// 小程序页面路径对于小游戏可以只传入 query 部分来实现传参效果传入 "?foo=bar"

View File

@ -498,26 +498,26 @@ RCT_EXPORT_METHOD(launchMiniProgram:(NSDictionary *)data
// callback(@[success ? [NSNull null] : INVOKE_FAILED]);
}
RCT_EXPORT_METHOD(pay:(NSDictionary *)data
:(RCTResponseSenderBlock)callback)
{
PayReq* req = [PayReq new];
req.partnerId = data[@"partnerId"];
req.prepayId = data[@"prepayId"];
req.nonceStr = data[@"nonceStr"];
req.timeStamp = [data[@"timeStamp"] unsignedIntValue];
req.package = data[@"package"];
req.sign = data[@"sign"];
void ( ^ completion )( BOOL );
completion = ^( BOOL success )
{
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
return;
};
[WXApi sendReq:req completion:completion];
// BOOL success = [WXApi sendReq:req];
//RCT_EXPORT_METHOD(pay:(NSDictionary *)data
// :(RCTResponseSenderBlock)callback)
//{
// PayReq* req = [PayReq new];
// req.partnerId = data[@"partnerId"];
// req.prepayId = data[@"prepayId"];
// req.nonceStr = data[@"nonceStr"];
// req.timeStamp = [data[@"timeStamp"] unsignedIntValue];
// req.package = data[@"package"];
// req.sign = data[@"sign"];
// void ( ^ completion )( BOOL );
// completion = ^( BOOL success )
// {
// callback(@[success ? [NSNull null] : INVOKE_FAILED]);
}
// return;
// };
// [WXApi sendReq:req completion:completion];
// // BOOL success = [WXApi sendReq:req];
// // callback(@[success ? [NSNull null] : INVOKE_FAILED]);
//}
#pragma mark - wx callback
@ -566,14 +566,14 @@ RCT_EXPORT_METHOD(pay:(NSDictionary *)data
else {
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body];
}
} else if ([resp isKindOfClass:[PayResp class]]) {
PayResp *r = (PayResp *)resp;
NSMutableDictionary *body = @{@"errCode":@(r.errCode)}.mutableCopy;
body[@"errStr"] = r.errStr;
body[@"type"] = @(r.type);
body[@"returnKey"] =r.returnKey;
body[@"type"] = @"PayReq.Resp";
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body];
// } else if ([resp isKindOfClass:[PayResp class]]) {
// PayResp *r = (PayResp *)resp;
// NSMutableDictionary *body = @{@"errCode":@(r.errCode)}.mutableCopy;
// body[@"errStr"] = r.errStr;
// body[@"type"] = @(r.type);
// body[@"returnKey"] =r.returnKey;
// body[@"type"] = @"PayReq.Resp";
// [self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body];
} else if ([resp isKindOfClass:[WXLaunchMiniProgramResp class]]){
WXLaunchMiniProgramResp *r = (WXLaunchMiniProgramResp *)resp;
NSMutableDictionary *body = @{@"errCode":@(r.errCode)}.mutableCopy;

View File

@ -8,8 +8,8 @@
Pod::Spec.new do |s|
s.name = "RCTWeChat"
s.version = "0.1.0"
s.summary = "React-Native(iOS/Android) functionalities include WeChat Login, Share, Favorite and Payment {QQ: 336021910}"
s.version = package['version']
s.summary = "React-Native(iOS/Android) functionalities include WeChat Login, Share, Favorite and Payment"
# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
@ -17,13 +17,13 @@ Pod::Spec.new do |s|
# * Write the description between the DESC delimiters below.
# * Finally, don't worry about the indent, CocoaPods strips it!
s.description = <<-DESC
React-Native(iOS/Android) functionalities include WeChat Login, Share, Favorite and Payment {QQ: 336021910}
React-Native(iOS/Android) functionalities include WeChat Login, Share, Favorite and Payment
DESC
s.homepage = "https://github.com/weflex/react-native-wechat"
s.license = "MIT"
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
s.author = { "weflex" => "336021910@qq.com" }
s.author = { "weflex" => "fox@sfxh.cc" }
s.platform = :ios, "7.0"
s.source = { :git => "https://github.com/weflex/react-native-wechat.git", :tag => "master" }
s.source_files = "**/*.{h,m}"
@ -32,7 +32,7 @@ Pod::Spec.new do |s|
# s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
s.dependency "React"
s.vendored_libraries = "libWeChatSDK.a"
s.ios.frameworks = 'SystemConfiguration','CoreTelephony','XCTest'
s.ios.frameworks = 'SystemConfiguration','CoreTelephony','XCTest','WebKit'
s.ios.library = 'sqlite3','c++','z'
end

View File

@ -163,92 +163,6 @@ typedef void(^WXCheckULCompletion)(WXULCheckStep step, WXCheckULStepResult* resu
#pragma mark - WXMediaMessage
@class WXMediaMessage;
#ifndef BUILD_WITHOUT_PAY
#pragma mark - PayReq
/*! @brief 第三方向微信终端发起支付的消息结构体
*
*
* @see PayResp
*/
@interface PayReq : BaseReq
/** 商家向财付通申请的商家id */
@property (nonatomic, copy) NSString *partnerId;
/** 预支付订单 */
@property (nonatomic, copy) NSString *prepayId;
/** 随机串,防重发 */
@property (nonatomic, copy) NSString *nonceStr;
/** 时间戳,防重发 */
@property (nonatomic, assign) UInt32 timeStamp;
/** 商家根据财付通文档填写的数据和签名 */
@property (nonatomic, copy) NSString *package;
/** 商家根据微信开放平台文档对数据做的签名 */
@property (nonatomic, copy) NSString *sign;
@end
#pragma mark - PayResp
/*! @brief 微信终端返回给第三方的关于支付结果的结构体
*
*
*/
@interface PayResp : BaseResp
/** 财付通返回给商家的信息 */
@property (nonatomic, copy) NSString *returnKey;
@end
#pragma mark - WXOfflinePay
/*! @brief 第三方向微信终端发起离线支付
*
* 线
*/
@interface WXOfflinePayReq : BaseReq
@end
/*! @brief 第三方向微信终端发起离线支付返回
*
* 线
*/
@interface WXOfflinePayResp : BaseResp
@end
#pragma mark - WXNontaxPayReq
@interface WXNontaxPayReq:BaseReq
@property (nonatomic, copy) NSString *urlString;
@end
#pragma mark - WXNontaxPayResp
@interface WXNontaxPayResp : BaseResp
@property (nonatomic, copy) NSString *wxOrderId;
@end
#pragma mark - WXPayInsuranceReq
@interface WXPayInsuranceReq : BaseReq
@property (nonatomic, copy) NSString *urlString;
@end
#pragma mark - WXPayInsuranceResp
@interface WXPayInsuranceResp : BaseResp
@property (nonatomic, copy) NSString *wxOrderId;
@end
#endif
#pragma mark - SendAuthReq
/*! @brief 第三方程序向微信终端请求认证的消息结构

Binary file not shown.

View File

@ -1,6 +1,6 @@
{
"name": "react-native-wechat-lib",
"version": "1.1.18",
"version": "1.1.25-notpay",
"description": "react-native library for wechat app. 支持分享和拉起小程序。",
"main": "index.js",
"scripts": {

1
react-native-wechat-lib Symbolic link
View File

@ -0,0 +1 @@
react-native-wechat-lib