Skip to content

Commit

Permalink
bump ios sdk to 15.8.18
Browse files Browse the repository at this point in the history
  • Loading branch information
JarvanMo committed Jul 4, 2024
1 parent 54f1b82 commit b6ce308
Show file tree
Hide file tree
Showing 31 changed files with 79 additions and 47 deletions.
2 changes: 0 additions & 2 deletions example/integration_test/plugin_integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
// https://docs.flutter.dev/cookbook/testing/integration/introduction


import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';

import 'package:tobias/tobias.dart';

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>12.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion example/ios/Flutter/Flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Pod::Spec.new do |s|
s.license = { :type => 'BSD' }
s.author = { 'Flutter Dev Team' => '[email protected]' }
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
s.ios.deployment_target = '11.0'
s.ios.deployment_target = '12.0'
# Framework linking is handled by Flutter tooling, not CocoaPods.
# Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.
s.vendored_frameworks = 'path/to/nothing'
Expand Down
5 changes: 3 additions & 2 deletions example/ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
export "FLUTTER_ROOT=/Users/mo/Development/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/mo/Code/Flutter/tobias/example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_TARGET=/Users/mo/Code/Flutter/tobias/example/lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==,RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC8wNDgxN2M5OWM5ZmQ0OTU2ZjI3NTA1MjA0ZjdlMzQ0MzM1ODEwYWVkLw=="
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
export "PACKAGE_CONFIG=/Users/mo/Code/Flutter/tobias/example/.dart_tool/package_config.json"
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/tobias/ios"

SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
integration_test: 13825b8a9334a850581300559b8839134b124670
tobias: 22f69183b14af82a2ac8ff698af084c352744e5f
tobias: cc3bf3abfe6138bbcac1d013b86b8bd872bbf613

PODFILE CHECKSUM: 3fa3b71e93b773646ea923db9defae9e3f1717ab
PODFILE CHECKSUM: beab77b38961de946f08660e554f80ac174dc842

COCOAPODS: 1.12.1
COCOAPODS: 1.15.2
8 changes: 4 additions & 4 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
331C80F0294D02FB00263BE5 = {
Expand Down Expand Up @@ -464,7 +464,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -582,7 +582,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -631,7 +631,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
3 changes: 1 addition & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:tobias/tobias.dart';

void main() {
Expand All @@ -16,7 +15,7 @@ class MyApp extends StatefulWidget {
}

class _MyAppState extends State<MyApp> {
String _platformVersion = 'Unknown';
final String _platformVersion = 'Unknown';
final _tobiasPlugin = Tobias();

@override
Expand Down
1 change: 1 addition & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ tobias:
url_scheme: tobiasexample
ios:
ignore_security: true
universal_link: https://testdomain.com
# no_utdid: true
10 changes: 5 additions & 5 deletions ios/AlipaySDK/NoUtdid/AlipaySDK.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>AlipaySDK.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>AlipaySDK.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

////////////////////////////////////////////////////////
///////////////// 支付宝标准版本支付SDK ///////////////////
///////// version:15.8.16 modify:2023.08.02///////////
///////// version:15.8.18 modify:2024.04.08///////////
////////////////////////////////////////////////////////

#import <UIKit/UIKit.h>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

////////////////////////////////////////////////////////
///////////////// 支付宝标准版本支付SDK ///////////////////
///////// version:15.8.16 modify:2023.08.02///////////
///////// version:15.8.18 modify:2024.04.08///////////
////////////////////////////////////////////////////////

#import <UIKit/UIKit.h>
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</data>
<key>Headers/AlipaySDK.h</key>
<data>
8XwC+MqQpDbmMpi+DX1Rqs4rmm4=
rnt9w8ZNAwK+Atg2Lz9JY8i50gE=
</data>
<key>Headers/AlipaySDKModule.h</key>
<data>
Expand Down Expand Up @@ -216,11 +216,11 @@
<dict>
<key>hash</key>
<data>
8XwC+MqQpDbmMpi+DX1Rqs4rmm4=
rnt9w8ZNAwK+Atg2Lz9JY8i50gE=
</data>
<key>hash2</key>
<data>
JzobtSIFkFOPENnZPYwM6VyyesCbgdsUTeeQZV4+ZXY=
+QeaUT1rQP8MWM0H/9KSlQ1rT18dgCIfsem/LycmPHY=
</data>
</dict>
<key>Headers/AlipaySDKModule.h</key>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

////////////////////////////////////////////////////////
///////////////// 支付宝标准版本支付SDK ///////////////////
///////// version:15.8.16 modify:2023.08.02///////////
///////// version:15.8.18 modify:2024.04.08///////////
////////////////////////////////////////////////////////

#import <UIKit/UIKit.h>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

////////////////////////////////////////////////////////
///////////////// 支付宝标准版本支付SDK ///////////////////
///////// version:15.8.16 modify:2023.08.02///////////
///////// version:15.8.18 modify:2024.04.08///////////
////////////////////////////////////////////////////////

#import <UIKit/UIKit.h>
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</data>
<key>Headers/AlipaySDK.h</key>
<data>
8XwC+MqQpDbmMpi+DX1Rqs4rmm4=
rnt9w8ZNAwK+Atg2Lz9JY8i50gE=
</data>
<key>Headers/AlipaySDKModule.h</key>
<data>
Expand Down Expand Up @@ -216,11 +216,11 @@
<dict>
<key>hash</key>
<data>
8XwC+MqQpDbmMpi+DX1Rqs4rmm4=
rnt9w8ZNAwK+Atg2Lz9JY8i50gE=
</data>
<key>hash2</key>
<data>
JzobtSIFkFOPENnZPYwM6VyyesCbgdsUTeeQZV4+ZXY=
+QeaUT1rQP8MWM0H/9KSlQ1rT18dgCIfsem/LycmPHY=
</data>
</dict>
<key>Headers/AlipaySDKModule.h</key>
Expand Down
16 changes: 12 additions & 4 deletions ios/Classes/TobiasPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDiction
return [self handleOpenURL:url];
}

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nonnull))restorationHandler{
if ([userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb]) {
[[AlipaySDK defaultService] handleOpenUniversalLink:userActivity standbyCallback:^(NSDictionary *resultDic) {
}];
}
return NO;
}

+(BOOL)handleOpenURL:(NSURL*)url{

Expand Down Expand Up @@ -127,15 +134,16 @@ -(void) pay:(FlutterMethodCall*)call result:(FlutterResult)result{

}

-(void) _pay:(FlutterMethodCall*)call result:(FlutterResult)result urlScheme:(NSString *)urlScheme{
-(void) _pay:(FlutterMethodCall*)call result:(FlutterResult)result urlScheme:(NSString *)urlScheme{
self.callback = result;

__weak TobiasPlugin* __self = self;

[[AlipaySDK defaultService] payOrder:call.arguments[@"order"] fromScheme:urlScheme callback:^(NSDictionary *resultDic) {
[__self onPayResultReceived:resultDic];
[[AlipaySDK defaultService] payOrder:call.arguments[@"order"] fromScheme:urlScheme fromUniversalLink: call.arguments[@"universalLink"] callback:^(NSDictionary *resultDic){
[__self onPayResultReceived:resultDic];
}];


}

-(void) _auth:(FlutterMethodCall*)call result:(FlutterResult)result {
Expand Down
11 changes: 9 additions & 2 deletions ios/tobias.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,21 @@ end
Pod::UI.puts "using sdk with #{tobias_subspec}"

ignore_security = ''
if cfg['fluwx'] && cfg['tobias']['ios'] && cfg['tobias']['ios']['ignore_security'] == true
if cfg['tobias'] && cfg['tobias']['ios'] && cfg['tobias']['ios']['ignore_security'] == true
ignore_security = '-i'
end
Pod::UI.puts "ignore_security: #{ignore_security}"

universal_link = ''
if cfg['tobias'] && cfg['tobias']['ios'] && cfg['tobias']['ios']['universal_link']
universal_link = cfg['tobias']['ios']['universal_link']
end
Pod::UI.puts "universal_link: #{universal_link}"


if cfg['tobias'] && cfg['tobias']['url_scheme']
url_scheme = cfg['tobias']['url_scheme']
system("ruby #{current_dir}/tobias_setup.rb #{ignore_security} -u #{url_scheme} -p #{project_dir} -n Runner.xcodeproj")
system("ruby #{current_dir}/tobias_setup.rb #{ignore_security} -u #{url_scheme} -l #{universal_link} -p #{project_dir} -n Runner.xcodeproj")
else
abort("required values:[url_scheme] are missing. Please add them in pubspec.yaml:\ntobias:\n url_scheme: ${url scheme}\n")
end
Expand Down
15 changes: 15 additions & 0 deletions ios/tobias_setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
options_dict[:url_scheme] = opts
end

options.on("-l", "--universalLink=UNIVERSALLINK", String, "Universal Link for AliPay") do |opts|
options_dict[:universal_link] = opts
end

end.parse!

# Minimum required arguments are a project directory and project name
Expand All @@ -51,6 +55,12 @@
project.targets.each do |target|
if target.name == "Runner"
url_scheme = options_dict[:url_scheme]
universal_link = options_dict[:universal_link]
applinks = ''

if (!url_scheme.nil? && !url_scheme.empty?)
applinks = "applinks:#{URI.parse(universal_link).host}"
end

sectionObject = {}
project.objects.each do |object|
Expand Down Expand Up @@ -143,6 +153,11 @@
domains = []
result["com.apple.developer.associated-domains"] = domains
end
isApplinksExist = domains.include? applinks
if !isApplinksExist
domains << applinks
File.write(codeSignEntitlementsFile, Plist::Emit.dump(result))
end
end
end
end
9 changes: 5 additions & 4 deletions lib/src/tobias.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import 'tobias_platform_interface.dart';

class Tobias {
/// [evn] only supports Android due to native AliPaySDK
Future<Map> pay(String order, {AliPayEvn evn = AliPayEvn.online}) async {
return await TobiasPlatform.instance.pay(order, evn: evn);
/// [universalLink] only supports iOS
Future<Map> pay(String order,
{AliPayEvn evn = AliPayEvn.online, String? universalLink}) async {
return await TobiasPlatform.instance
.pay(order, evn: evn, universalLink: universalLink);
}

/// Auth by AliPay
Expand All @@ -26,6 +29,4 @@ class Tobias {
Future<bool> get isAliPayHKInstalled async {
return await TobiasPlatform.instance.isAliPayHKInstalled;
}


}
8 changes: 5 additions & 3 deletions lib/src/tobias_method_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ class MethodChannelTobias extends TobiasPlatform {
final methodChannel = const MethodChannel('com.jarvanmo/tobias');

/// [evn] only supports Android due to native AliPaySDK
/// [universalLink] only supports iOS
@override
Future<Map> pay(String order, {AliPayEvn evn = AliPayEvn.online}) async {
return await methodChannel
.invokeMethod("pay", {"order": order, "payEnv": evn.index});
Future<Map> pay(String order,
{AliPayEvn evn = AliPayEvn.online, String? universalLink}) async {
return await methodChannel.invokeMethod("pay",
{"order": order, "payEnv": evn.index, "universalLink": universalLink});
}

/// Auth by AliPay
Expand Down
2 changes: 1 addition & 1 deletion lib/src/tobias_platform_interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ abstract class TobiasPlatform extends PlatformInterface {
}

/// [evn] only supports Android due to native AliPaySDK
Future<Map> pay(String order, {AliPayEvn evn = AliPayEvn.online}) async {
Future<Map> pay(String order, {AliPayEvn evn = AliPayEvn.online, String? universalLink}) async {
throw UnimplementedError('pay() has not been implemented.');
}

Expand Down

0 comments on commit b6ce308

Please sign in to comment.