提交 6c02b1e2 authored 作者: JarvanMo's avatar JarvanMo

support enable/disable scene_delegate

上级 870cbe12
...@@ -29,7 +29,7 @@ EXTERNAL SOURCES: ...@@ -29,7 +29,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
fluwx: d725e175af372180498ce6daad7be464f48c78b5 fluwx: 3c7b6df42f83d444d4538f3eaeae079f12d30c37
integration_test: 13825b8a9334a850581300559b8839134b124670 integration_test: 13825b8a9334a850581300559b8839134b124670
WechatOpenSDK-XCFramework: acdeeda129efbef9532bca8a10c24e1b4b8c7d69 WechatOpenSDK-XCFramework: acdeeda129efbef9532bca8a10c24e1b4b8c7d69
......
...@@ -84,13 +84,14 @@ flutter: ...@@ -84,13 +84,14 @@ flutter:
# see https://flutter.dev/custom-fonts/#from-packages # see https://flutter.dev/custom-fonts/#from-packages
fluwx: fluwx:
# app_id: 123456 # app_id: 123456
# only debug in debug mode # only debug in debug mode
debug_logging: true debug_logging: true
android: android:
# interrupt_wx_request: true # default is true # interrupt_wx_request: true # default is true
# flutter_activity: MainActivity #Default to launch app's launcher # flutter_activity: MainActivity #Default to launch app's launcher
ios: ios:
universal_link: https://testdomain.com universal_link: https://testdomain.com
scene_delegate: true #default false
# payment is enabled by default # payment is enabled by default
# no_pay: true # no_pay: true
...@@ -390,12 +390,17 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar; ...@@ -390,12 +390,17 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
return [WXApi handleOpenURL:url delegate:self]; return [WXApi handleOpenURL:url delegate:self];
} }
#ifndef SCENE_DELEGATE
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nonnull))restorationHandler{ - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nonnull))restorationHandler{
return [WXApi handleOpenUniversalLink:userActivity delegate:self]; return [WXApi handleOpenUniversalLink:userActivity delegate:self];
} }
#endif
#ifdef SCENE_DELEGATE
- (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity API_AVAILABLE(ios(13.0)){ - (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity API_AVAILABLE(ios(13.0)){
[WXApi handleOpenUniversalLink:userActivity delegate:self]; [WXApi handleOpenUniversalLink:userActivity delegate:self];
} }
#endif
- (void)handleOpenUrlCall:(FlutterMethodCall *)call - (void)handleOpenUrlCall:(FlutterMethodCall *)call
result:(FlutterResult)result { result:(FlutterResult)result {
......
...@@ -16,11 +16,22 @@ calling_dir = File.dirname(__FILE__) ...@@ -16,11 +16,22 @@ calling_dir = File.dirname(__FILE__)
project_dir = calling_dir.slice(0..(calling_dir.index('/.symlinks'))) project_dir = calling_dir.slice(0..(calling_dir.index('/.symlinks')))
flutter_project_dir = calling_dir.slice(0..(calling_dir.index('/ios/.symlinks'))) flutter_project_dir = calling_dir.slice(0..(calling_dir.index('/ios/.symlinks')))
cfg = YAML.load_file(File.join(flutter_project_dir, 'pubspec.yaml')) cfg = YAML.load_file(File.join(flutter_project_dir, 'pubspec.yaml'))
debug_logging = false logging_status = "WECHAT_LOGGING=0"
if cfg['fluwx'] && cfg['fluwx']['debug_logging'] == true if cfg['fluwx'] && cfg['fluwx']['debug_logging'] == true
debug_logging = true logging_status = 'WECHAT_LOGGING=1'
else
logging_status = 'WECHAT_LOGGING=0'
end end
scene_delegate = ''
if cfg['fluwx'] && cfg['fluwx']['ios'] && cfg['fluwx']['ios']['scene_delegate'] == true
scene_delegate = 'SCENE_DELEGATE=1'
else
scene_delegate = ''
end
if cfg['fluwx'] && cfg['fluwx']['ios'] && cfg['fluwx']['ios']['no_pay'] == true if cfg['fluwx'] && cfg['fluwx']['ios'] && cfg['fluwx']['ios']['no_pay'] == true
fluwx_subspec = 'no_pay' fluwx_subspec = 'no_pay'
else else
...@@ -34,6 +45,7 @@ if cfg['fluwx'] && cfg['fluwx']['app_id'] ...@@ -34,6 +45,7 @@ if cfg['fluwx'] && cfg['fluwx']['app_id']
app_id = cfg['fluwx']['app_id'] app_id = cfg['fluwx']['app_id']
end end
if cfg['fluwx'] && (cfg['fluwx']['ios'] && cfg['fluwx']['ios']['universal_link']) if cfg['fluwx'] && (cfg['fluwx']['ios'] && cfg['fluwx']['ios']['universal_link'])
universal_link = cfg['fluwx']['ios']['universal_link'] universal_link = cfg['fluwx']['ios']['universal_link']
if app_id.nil? if app_id.nil?
...@@ -70,11 +82,8 @@ The capability of implementing WeChat SDKs in Flutter. With Fluwx, developers ca ...@@ -70,11 +82,8 @@ The capability of implementing WeChat SDKs in Flutter. With Fluwx, developers ca
s.subspec 'pay' do |sp| s.subspec 'pay' do |sp|
sp.dependency 'WechatOpenSDK-XCFramework','~> 2.0.2' sp.dependency 'WechatOpenSDK-XCFramework','~> 2.0.2'
if debug_logging pod_target_xcconfig["GCC_PREPROCESSOR_DEFINITIONS"] = "$(inherited) #{logging_status} #{scene_delegate}"
pod_target_xcconfig["GCC_PREPROCESSOR_DEFINITIONS"] = '$(inherited) WECHAT_LOGGING=1'
else
pod_target_xcconfig["GCC_PREPROCESSOR_DEFINITIONS"] = '$(inherited) WECHAT_LOGGING=0'
end
sp.pod_target_xcconfig = pod_target_xcconfig sp.pod_target_xcconfig = pod_target_xcconfig
end end
...@@ -82,12 +91,8 @@ The capability of implementing WeChat SDKs in Flutter. With Fluwx, developers ca ...@@ -82,12 +91,8 @@ The capability of implementing WeChat SDKs in Flutter. With Fluwx, developers ca
sp.dependency 'OpenWeChatSDKNoPay','~> 2.0.2+2' sp.dependency 'OpenWeChatSDKNoPay','~> 2.0.2+2'
sp.frameworks = 'CoreGraphics', 'Security', 'WebKit' sp.frameworks = 'CoreGraphics', 'Security', 'WebKit'
sp.libraries = 'c++', 'z', 'sqlite3.0' sp.libraries = 'c++', 'z', 'sqlite3.0'
if debug_logging pod_target_xcconfig["GCC_PREPROCESSOR_DEFINITIONS"] = "$(inherited) NO_PAY=1 #{logging_status} #{scene_delegate}"
pod_target_xcconfig["GCC_PREPROCESSOR_DEFINITIONS"] = '$(inherited) NO_PAY=1 WECHAT_LOGGING=1' sp.pod_target_xcconfig = pod_target_xcconfig
else
pod_target_xcconfig["GCC_PREPROCESSOR_DEFINITIONS"] = '$(inherited) NO_PAY=1 WECHAT_LOGGING=0'
end
sp.pod_target_xcconfig = pod_target_xcconfig
end end
# Flutter.framework does not contain a i386 slice. # Flutter.framework does not contain a i386 slice.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论