diff --git a/CHANGELOG.md b/CHANGELOG.md
index c0e0999f..58dcae05 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,11 @@
+# 6.0.0-preview.2
+* iOS旧的回调加回来了
+
+# 6.0.0-preview.1
+* Flutter 版本要求升级到3.38.0或更高
+* Dart 版本要求升级到3.10.0或更高
+* 支持UISceneDelegate。
+
# 5.7.5
* 更新:鸿蒙端支持分享文件
* 更新:鸿蒙端支持打开客服会话
diff --git a/example/.gitignore b/example/.gitignore
index 24476c5d..6c319542 100644
--- a/example/.gitignore
+++ b/example/.gitignore
@@ -5,9 +5,11 @@
*.swp
.DS_Store
.atom/
+.build/
.buildlog/
.history
.svn/
+.swiftpm/
migrate_working_dir/
# IntelliJ related
diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist
index 7c569640..1dc6cf76 100644
--- a/example/ios/Flutter/AppFrameworkInfo.plist
+++ b/example/ios/Flutter/AppFrameworkInfo.plist
@@ -21,6 +21,6 @@
CFBundleVersion
1.0
MinimumOSVersion
- 12.0
+ 13.0
diff --git a/example/ios/Podfile b/example/ios/Podfile
index c9339a03..6eafd7e2 100644
--- a/example/ios/Podfile
+++ b/example/ios/Podfile
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
-# platform :ios, '12.0'
+# platform :ios, '13.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock
index 759eece3..88e4fc90 100644
--- a/example/ios/Podfile.lock
+++ b/example/ios/Podfile.lock
@@ -5,15 +5,12 @@ PODS:
- fluwx/pay (= 0.0.1)
- fluwx/pay (0.0.1):
- Flutter
- - WechatOpenSDK-XCFramework (~> 2.0.4)
- - integration_test (0.0.1):
- - Flutter
- - WechatOpenSDK-XCFramework (2.0.4)
+ - WechatOpenSDK-XCFramework (~> 2.0.5)
+ - WechatOpenSDK-XCFramework (2.0.5)
DEPENDENCIES:
- Flutter (from `Flutter`)
- fluwx (from `.symlinks/plugins/fluwx/ios`)
- - integration_test (from `.symlinks/plugins/integration_test/ios`)
SPEC REPOS:
trunk:
@@ -24,15 +21,12 @@ EXTERNAL SOURCES:
:path: Flutter
fluwx:
:path: ".symlinks/plugins/fluwx/ios"
- integration_test:
- :path: ".symlinks/plugins/integration_test/ios"
SPEC CHECKSUMS:
- Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
- fluwx: c18fd6c16b03a2187cd07d6e48e32a7801962849
- integration_test: 13825b8a9334a850581300559b8839134b124670
- WechatOpenSDK-XCFramework: 36fb2bea0754266c17184adf4963d7e6ff98b69f
+ Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
+ fluwx: 6f0b28c68aef77900ef67728e66091cd8022739f
+ WechatOpenSDK-XCFramework: ff342ae616bb86df3d236aca38059dfd4bc4a949
-PODFILE CHECKSUM: 6e700dec67e6deac9b1c69bb14c49a2217a12d15
+PODFILE CHECKSUM: a3b6f034f0d79a209652621b979bc9d6707da7a1
-COCOAPODS: 1.15.2
+COCOAPODS: 1.16.2
diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj
index 029ed8f9..a745e568 100644
--- a/example/ios/Runner.xcodeproj/project.pbxproj
+++ b/example/ios/Runner.xcodeproj/project.pbxproj
@@ -17,6 +17,7 @@
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
F3F2D014A64FDD073F05B4CA /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F1790AB3CDE0ED1C0E115C2 /* libPods-Runner.a */; };
+ 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -68,6 +69,7 @@
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
A9DDFA5760AD388C7AE67D68 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; };
F071110615569824B74AF901 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
+ 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -83,6 +85,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
F3F2D014A64FDD073F05B4CA /* libPods-Runner.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -101,6 +104,7 @@
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
+ 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
@@ -200,6 +204,9 @@
productType = "com.apple.product-type.bundle.unit-test";
};
97C146ED1CF9000F007C117D /* Runner */ = {
+ packageProductDependencies = (
+ 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
+ );
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
@@ -225,6 +232,9 @@
/* Begin PBXProject section */
97C146E61CF9000F007C117D /* Project object */ = {
+ packageReferences = (
+ 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */,
+ );
isa = PBXProject;
attributes = {
KnownAssetTags = (
@@ -467,7 +477,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 12.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
@@ -585,7 +595,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 12.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -634,7 +644,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 12.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
@@ -717,6 +727,18 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
+/* Begin XCLocalSwiftPackageReference section */
+ 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = {
+ isa = XCLocalSwiftPackageReference;
+ relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
+ };
+/* End XCLocalSwiftPackageReference section */
+/* Begin XCSwiftPackageProductDependency section */
+ 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
+ isa = XCSwiftPackageProductDependency;
+ productName = FlutterGeneratedPluginSwiftPackage;
+ };
+/* End XCSwiftPackageProductDependency section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index 3d0fb007..1f70c354 100644
--- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -5,6 +5,24 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/example/ios/Runner/AppDelegate.h b/example/ios/Runner/AppDelegate.h
index 36e21bbf..01e6e1d4 100644
--- a/example/ios/Runner/AppDelegate.h
+++ b/example/ios/Runner/AppDelegate.h
@@ -1,6 +1,6 @@
#import
#import
-@interface AppDelegate : FlutterAppDelegate
+@interface AppDelegate : FlutterAppDelegate
@end
diff --git a/example/ios/Runner/AppDelegate.m b/example/ios/Runner/AppDelegate.m
index 70e83933..cebafc9e 100644
--- a/example/ios/Runner/AppDelegate.m
+++ b/example/ios/Runner/AppDelegate.m
@@ -5,9 +5,12 @@ @implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
- [GeneratedPluginRegistrant registerWithRegistry:self];
// Override point for customization after application launch.
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
+- (void)didInitializeImplicitFlutterEngine:(NSObject*)engineBridge {
+ [GeneratedPluginRegistrant registerWithRegistry:engineBridge.pluginRegistry];
+}
+
@end
diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist
index 8a2e7976..71b1ccab 100644
--- a/example/ios/Runner/Info.plist
+++ b/example/ios/Runner/Info.plist
@@ -11,7 +11,7 @@
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleGetInfoString
-
+
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
@@ -40,7 +40,7 @@
CFBundleVersion
$(FLUTTER_BUILD_NUMBER)
LSApplicationCategoryType
-
+
LSApplicationQueriesSchemes
weixin
@@ -56,6 +56,27 @@
NSAllowsArbitraryLoadsInWebContent
+ UIApplicationSceneManifest
+
+ UIApplicationSupportsMultipleScenes
+
+ UISceneConfigurations
+
+ UIWindowSceneSessionRoleApplication
+
+
+ UISceneClassName
+ UIWindowScene
+ UISceneConfigurationName
+ flutter
+ UISceneDelegateClassName
+ FlutterSceneDelegate
+ UISceneStoryboardFile
+ Main
+
+
+
+
UIApplicationSupportsIndirectInputEvents
UILaunchStoryboardName
diff --git a/example/pubspec.yaml b/example/pubspec.yaml
index d3e1a19a..cab0422b 100644
--- a/example/pubspec.yaml
+++ b/example/pubspec.yaml
@@ -15,7 +15,6 @@ fluwx:
# flutter_activity: 'MainActivity' # Defaults to app's launcher
ios:
universal_link: https://testdomain.com
-# scene_delegate: true # Defaults to false.
# no_pay: true # Set to true to disable payment.
# ignore_security: true # Set to true to disable security seetings.
diff --git a/ios/Classes/FluwxPlugin.m b/ios/Classes/FluwxPlugin.m
index 089d2fd2..266a3f11 100644
--- a/ios/Classes/FluwxPlugin.m
+++ b/ios/Classes/FluwxPlugin.m
@@ -71,6 +71,7 @@ + (void)registerWithRegistrar:(NSObject *)registrar {
binaryMessenger:[registrar messenger]];
FluwxPlugin *instance = [[FluwxPlugin alloc] initWithChannel:channel];
[registrar addApplicationDelegate:instance];
+ [registrar addSceneDelegate:instance];
[registrar addMethodCallDelegate:instance channel:channel];
}
@@ -441,19 +442,41 @@ - (BOOL)application:(UIApplication *)app
}
}
-#ifndef SCENE_DELEGATE
+// Available on iOS 9.0 and later
+// See https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623112-application?language=objc
+- (BOOL)application:(UIApplication *)app
+ openURL:(NSURL *)url
+ options:(NSDictionary *)options {
+ // ↓ previous solution -- according to document, this may fail if the WXApi hasn't registered yet.
+ // return [WXApi handleOpenURL:url delegate:self];
+
+ if (_isRunning) {
+ // registered -- directly handle open url request by WXApi
+ return [WXApi handleOpenURL:url delegate:self];
+ } else {
+ // unregistered -- cache open url request and handle it once WXApi is registered
+ __weak typeof(self) weakSelf = self;
+ _cachedOpenUrlRequest = ^() {
+ __strong typeof(weakSelf) strongSelf = weakSelf;
+ [WXApi handleOpenURL:url delegate:strongSelf];
+ };
+ // Let's hold this until the PR contributor send feedback.
+ //return [url.absoluteString contains:[self fetchWeChatAppId]];
+
+ // simply return YES to indicate that we can handle open url request later
+ return NO;
+ }
+}
+
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *_Nonnull))restorationHandler{
// TODO: (if need) cache userActivity and handle it once WXApi is registered
return [WXApi handleOpenUniversalLink:userActivity delegate:self];
}
-#endif
-#ifdef SCENE_DELEGATE
- (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity API_AVAILABLE(ios(13.0)) {
// TODO: (if need) cache userActivity and handle it once WXApi is registered
[WXApi handleOpenUniversalLink:userActivity delegate:self];
}
-#endif
- (void)handleOpenUrlCall:(FlutterMethodCall *)call
result:(FlutterResult)result {
diff --git a/ios/Classes/public/FluwxPlugin.h b/ios/Classes/public/FluwxPlugin.h
index 40efc474..4b60454e 100644
--- a/ios/Classes/public/FluwxPlugin.h
+++ b/ios/Classes/public/FluwxPlugin.h
@@ -1,4 +1,4 @@
#import
-@interface FluwxPlugin : NSObject
+@interface FluwxPlugin : NSObject
@end
diff --git a/ios/fluwx.podspec b/ios/fluwx.podspec
index a1453ed7..de4e3b54 100644
--- a/ios/fluwx.podspec
+++ b/ios/fluwx.podspec
@@ -37,13 +37,6 @@ else
logging_status = 'WECHAT_LOGGING=0'
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
fluwx_subspec = 'no_pay'
@@ -100,6 +93,7 @@ The capability of implementing WeChat SDKs in Flutter. With Fluwx, developers ca
s.static_framework = true
s.resource_bundles = {'fluwx_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
s.default_subspec = fluwx_subspec
+ s.swift_version = '5.0'
pod_target_xcconfig = {
'OTHER_LDFLAGS' => '$(inherited) -ObjC -all_load'
@@ -108,16 +102,17 @@ The capability of implementing WeChat SDKs in Flutter. With Fluwx, developers ca
s.subspec 'pay' do |sp|
sp.dependency 'WechatOpenSDK-XCFramework','~> 2.0.5'
- pod_target_xcconfig["GCC_PREPROCESSOR_DEFINITIONS"] = "$(inherited) #{logging_status} #{scene_delegate}"
+ pod_target_xcconfig["GCC_PREPROCESSOR_DEFINITIONS"] = "$(inherited) #{logging_status}"
sp.pod_target_xcconfig = pod_target_xcconfig
+
end
s.subspec 'no_pay' do |sp|
sp.dependency 'OpenWeChatSDKNoPay','~> 2.0.5'
sp.frameworks = 'CoreGraphics', 'Security', 'WebKit'
sp.libraries = 'c++', 'z', 'sqlite3.0'
- pod_target_xcconfig["GCC_PREPROCESSOR_DEFINITIONS"] = "$(inherited) NO_PAY=1 #{logging_status} #{scene_delegate}"
+ pod_target_xcconfig["GCC_PREPROCESSOR_DEFINITIONS"] = "$(inherited) NO_PAY=1 #{logging_status}"
sp.pod_target_xcconfig = pod_target_xcconfig
end
diff --git a/pubspec.yaml b/pubspec.yaml
index 125453ca..a92f1d1a 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,11 +1,11 @@
name: fluwx
description: The capability of implementing WeChat SDKs in Flutter. With Fluwx, developers can use WeChatSDK easily, such as sharing, payment, lanuch mini program and etc.
-version: 5.7.5
+version: 6.0.0-preview.2
homepage: https://github.com/OpenFlutter/fluwx
environment:
- sdk: '>=3.0.0 <4.0.0'
- flutter: ">=3.3.0"
+ sdk: ^3.10.0
+ flutter: ">=3.38.0"
dependencies:
flutter: