Showing
20 changed files
with
204 additions
and
22 deletions
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | archiveVersion = 1; | 3 | archiveVersion = 1; |
| 4 | classes = { | 4 | classes = { |
| 5 | }; | 5 | }; |
| 6 | - objectVersion = 54; | 6 | + objectVersion = 77; |
| 7 | objects = { | 7 | objects = { |
| 8 | 8 | ||
| 9 | /* Begin PBXBuildFile section */ | 9 | /* Begin PBXBuildFile section */ |
| @@ -342,10 +342,14 @@ | @@ -342,10 +342,14 @@ | ||
| 342 | inputFileListPaths = ( | 342 | inputFileListPaths = ( |
| 343 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", | 343 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", |
| 344 | ); | 344 | ); |
| 345 | + inputPaths = ( | ||
| 346 | + ); | ||
| 345 | name = "[CP] Embed Pods Frameworks"; | 347 | name = "[CP] Embed Pods Frameworks"; |
| 346 | outputFileListPaths = ( | 348 | outputFileListPaths = ( |
| 347 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", | 349 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", |
| 348 | ); | 350 | ); |
| 351 | + outputPaths = ( | ||
| 352 | + ); | ||
| 349 | runOnlyForDeploymentPostprocessing = 0; | 353 | runOnlyForDeploymentPostprocessing = 0; |
| 350 | shellPath = /bin/sh; | 354 | shellPath = /bin/sh; |
| 351 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; | 355 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; |
| @@ -416,10 +420,14 @@ | @@ -416,10 +420,14 @@ | ||
| 416 | inputFileListPaths = ( | 420 | inputFileListPaths = ( |
| 417 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", | 421 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", |
| 418 | ); | 422 | ); |
| 423 | + inputPaths = ( | ||
| 424 | + ); | ||
| 419 | name = "[CP] Copy Pods Resources"; | 425 | name = "[CP] Copy Pods Resources"; |
| 420 | outputFileListPaths = ( | 426 | outputFileListPaths = ( |
| 421 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", | 427 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", |
| 422 | ); | 428 | ); |
| 429 | + outputPaths = ( | ||
| 430 | + ); | ||
| 423 | runOnlyForDeploymentPostprocessing = 0; | 431 | runOnlyForDeploymentPostprocessing = 0; |
| 424 | shellPath = /bin/sh; | 432 | shellPath = /bin/sh; |
| 425 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; | 433 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; |
| @@ -652,7 +660,7 @@ | @@ -652,7 +660,7 @@ | ||
| 652 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; | 660 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; |
| 653 | CODE_SIGN_ENTITLEMENTS = "Runner Watch App/Runner Watch AppDebug.entitlements"; | 661 | CODE_SIGN_ENTITLEMENTS = "Runner Watch App/Runner Watch AppDebug.entitlements"; |
| 654 | CODE_SIGN_STYLE = Automatic; | 662 | CODE_SIGN_STYLE = Automatic; |
| 655 | - CURRENT_PROJECT_VERSION = 23; | 663 | + CURRENT_PROJECT_VERSION = 80; |
| 656 | DEVELOPMENT_TEAM = ZRPLMC329K; | 664 | DEVELOPMENT_TEAM = ZRPLMC329K; |
| 657 | ENABLE_PREVIEWS = YES; | 665 | ENABLE_PREVIEWS = YES; |
| 658 | GENERATE_INFOPLIST_FILE = YES; | 666 | GENERATE_INFOPLIST_FILE = YES; |
| @@ -666,7 +674,7 @@ | @@ -666,7 +674,7 @@ | ||
| 666 | "$(inherited)", | 674 | "$(inherited)", |
| 667 | "@executable_path/Frameworks", | 675 | "@executable_path/Frameworks", |
| 668 | ); | 676 | ); |
| 669 | - MARKETING_VERSION = 1.4.0; | 677 | + MARKETING_VERSION = 2.5.0; |
| 670 | ONLY_ACTIVE_ARCH = YES; | 678 | ONLY_ACTIVE_ARCH = YES; |
| 671 | PRODUCT_BUNDLE_IDENTIFIER = com.luiz.doublefeel.watchkitapp; | 679 | PRODUCT_BUNDLE_IDENTIFIER = com.luiz.doublefeel.watchkitapp; |
| 672 | PRODUCT_NAME = "$(TARGET_NAME)"; | 680 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| @@ -690,7 +698,7 @@ | @@ -690,7 +698,7 @@ | ||
| 690 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; | 698 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; |
| 691 | CODE_SIGN_ENTITLEMENTS = "Runner Watch App/Runner Watch App.entitlements"; | 699 | CODE_SIGN_ENTITLEMENTS = "Runner Watch App/Runner Watch App.entitlements"; |
| 692 | CODE_SIGN_STYLE = Automatic; | 700 | CODE_SIGN_STYLE = Automatic; |
| 693 | - CURRENT_PROJECT_VERSION = 23; | 701 | + CURRENT_PROJECT_VERSION = 80; |
| 694 | DEVELOPMENT_TEAM = ZRPLMC329K; | 702 | DEVELOPMENT_TEAM = ZRPLMC329K; |
| 695 | ENABLE_PREVIEWS = YES; | 703 | ENABLE_PREVIEWS = YES; |
| 696 | GENERATE_INFOPLIST_FILE = YES; | 704 | GENERATE_INFOPLIST_FILE = YES; |
| @@ -704,7 +712,7 @@ | @@ -704,7 +712,7 @@ | ||
| 704 | "$(inherited)", | 712 | "$(inherited)", |
| 705 | "@executable_path/Frameworks", | 713 | "@executable_path/Frameworks", |
| 706 | ); | 714 | ); |
| 707 | - MARKETING_VERSION = 1.4.0; | 715 | + MARKETING_VERSION = 2.5.0; |
| 708 | PRODUCT_BUNDLE_IDENTIFIER = com.luiz.doublefeel.watchkitapp; | 716 | PRODUCT_BUNDLE_IDENTIFIER = com.luiz.doublefeel.watchkitapp; |
| 709 | PRODUCT_NAME = "$(TARGET_NAME)"; | 717 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 710 | SDKROOT = watchos; | 718 | SDKROOT = watchos; |
| @@ -729,7 +737,7 @@ | @@ -729,7 +737,7 @@ | ||
| 729 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; | 737 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; |
| 730 | CODE_SIGN_ENTITLEMENTS = "Runner/Runner-Debug.entitlements"; | 738 | CODE_SIGN_ENTITLEMENTS = "Runner/Runner-Debug.entitlements"; |
| 731 | CODE_SIGN_STYLE = Automatic; | 739 | CODE_SIGN_STYLE = Automatic; |
| 732 | - CURRENT_PROJECT_VERSION = 73; | 740 | + CURRENT_PROJECT_VERSION = " 80"; |
| 733 | DEVELOPMENT_TEAM = ZRPLMC329K; | 741 | DEVELOPMENT_TEAM = ZRPLMC329K; |
| 734 | ENABLE_PREVIEWS = YES; | 742 | ENABLE_PREVIEWS = YES; |
| 735 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; | 743 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; |
| @@ -808,7 +816,7 @@ | @@ -808,7 +816,7 @@ | ||
| 808 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; | 816 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; |
| 809 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 817 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 810 | CODE_SIGN_STYLE = Automatic; | 818 | CODE_SIGN_STYLE = Automatic; |
| 811 | - CURRENT_PROJECT_VERSION = 73; | 819 | + CURRENT_PROJECT_VERSION = " 80"; |
| 812 | DEVELOPMENT_TEAM = ZRPLMC329K; | 820 | DEVELOPMENT_TEAM = ZRPLMC329K; |
| 813 | ENABLE_PREVIEWS = YES; | 821 | ENABLE_PREVIEWS = YES; |
| 814 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; | 822 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; |
| @@ -35,17 +35,7 @@ class AppDelegate: NSObject, UIApplicationDelegate { | @@ -35,17 +35,7 @@ class AppDelegate: NSObject, UIApplicationDelegate { | ||
| 35 | _ application: UIApplication, | 35 | _ application: UIApplication, |
| 36 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? | 36 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? |
| 37 | ) -> Bool { | 37 | ) -> Bool { |
| 38 | - AppShared.shared.agent.genUA() | ||
| 39 | - AppShared.shared.payment.delegate = self | ||
| 40 | - _ = AppShared.shared.payment.listenForTransactions() | ||
| 41 | - | ||
| 42 | - UIApplication.shared.registerForRemoteNotifications() | ||
| 43 | - UNUserNotificationCenter.current().setBadgeCount(0) | ||
| 44 | - UNUserNotificationCenter.current().delegate = self | ||
| 45 | - requestIDFAAuthorization() | ||
| 46 | - | ||
| 47 | - WatchConnectivityService.shared.activate() | ||
| 48 | - HealthKitService.shared.startBackgroundObserversIfNeeded() | 38 | + setup() |
| 49 | cacheLaunchURLIfNeeded(launchOptions) | 39 | cacheLaunchURLIfNeeded(launchOptions) |
| 50 | return true | 40 | return true |
| 51 | } | 41 | } |
| @@ -71,6 +61,20 @@ class AppDelegate: NSObject, UIApplicationDelegate { | @@ -71,6 +61,20 @@ class AppDelegate: NSObject, UIApplicationDelegate { | ||
| 71 | handleFlutterUrl(urlString) | 61 | handleFlutterUrl(urlString) |
| 72 | return true | 62 | return true |
| 73 | } | 63 | } |
| 64 | + | ||
| 65 | + func setup(){ | ||
| 66 | + AppShared.shared.agent.genUA() | ||
| 67 | + AppShared.shared.payment.delegate = self | ||
| 68 | + _ = AppShared.shared.payment.listenForTransactions() | ||
| 69 | + | ||
| 70 | + UIApplication.shared.registerForRemoteNotifications() | ||
| 71 | + UNUserNotificationCenter.current().setBadgeCount(0) | ||
| 72 | + UNUserNotificationCenter.current().delegate = self | ||
| 73 | + requestIDFAAuthorization() | ||
| 74 | + | ||
| 75 | + WatchConnectivityService.shared.activate() | ||
| 76 | + HealthKitService.shared.startBackgroundObserversIfNeeded() | ||
| 77 | + } | ||
| 74 | 78 | ||
| 75 | func warmUpFlutterEngineIfNeeded() { | 79 | func warmUpFlutterEngineIfNeeded() { |
| 76 | guard !isFlutterEngineReady else { | 80 | guard !isFlutterEngineReady else { |
| @@ -26,6 +26,7 @@ NS_ASSUME_NONNULL_END | @@ -26,6 +26,7 @@ NS_ASSUME_NONNULL_END | ||
| 26 | #import "OBSClient.h" | 26 | #import "OBSClient.h" |
| 27 | #import "OBSServiceBaseModel.h" | 27 | #import "OBSServiceBaseModel.h" |
| 28 | #import "OBSUtils.h" | 28 | #import "OBSUtils.h" |
| 29 | +#import "OBSLocalTimeUtils.h" | ||
| 29 | #import "OBSBolts.h" | 30 | #import "OBSBolts.h" |
| 30 | #import "OBSServiceCredentialProvider.h" | 31 | #import "OBSServiceCredentialProvider.h" |
| 31 | #import "OBSMantle.h" | 32 | #import "OBSMantle.h" |
| @@ -120,7 +121,7 @@ NS_ASSUME_NONNULL_END | @@ -120,7 +121,7 @@ NS_ASSUME_NONNULL_END | ||
| 120 | #import "OBSDeleteObjectModel.h" | 121 | #import "OBSDeleteObjectModel.h" |
| 121 | #import "OBSDeleteObjectsModel.h" | 122 | #import "OBSDeleteObjectsModel.h" |
| 122 | 123 | ||
| 123 | -#pragma mark additional | 124 | +#pragma mark additional |
| 124 | #import "OBSDownloadFileModel.h" | 125 | #import "OBSDownloadFileModel.h" |
| 125 | #import "OBSUploadFileModel.h" | 126 | #import "OBSUploadFileModel.h" |
| 126 | 127 |
| @@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
| 10 | #define OBSBaseDefinition_h | 10 | #define OBSBaseDefinition_h |
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | -static NSString *const OBSSDKVersion =@"3.24.4"; | 13 | +static NSString *const OBSSDKVersion =@"3.25.6"; |
| 14 | 14 | ||
| 15 | static NSUInteger const maxConcurrentRequestCountDefault =3; | 15 | static NSUInteger const maxConcurrentRequestCountDefault =3; |
| 16 | 16 | ||
| @@ -26,6 +26,7 @@ static NSString *const OBSClientErrorHTTPRequestIDKey =@"RequestID"; | @@ -26,6 +26,7 @@ static NSString *const OBSClientErrorHTTPRequestIDKey =@"RequestID"; | ||
| 26 | static NSString *const OBSClientErrorHTTPCodeKey =@"HTTPErrorCode"; | 26 | static NSString *const OBSClientErrorHTTPCodeKey =@"HTTPErrorCode"; |
| 27 | static NSString *const OBSClientErrorHTTPBodyKey =@"HTTPErrorBody"; | 27 | static NSString *const OBSClientErrorHTTPBodyKey =@"HTTPErrorBody"; |
| 28 | static NSString *const OBSClientErrorInvalidParameter =@"InvalidParameter"; | 28 | static NSString *const OBSClientErrorInvalidParameter =@"InvalidParameter"; |
| 29 | +static NSString *const OBSRequestTimeTooSkewedError =@"RequestTimeTooSkewed"; | ||
| 29 | 30 | ||
| 30 | static char *const OBSProcessorsQueueName ="com.obs.sdk.processors"; | 31 | static char *const OBSProcessorsQueueName ="com.obs.sdk.processors"; |
| 31 | static NSString *const OBSMaxConcurrentCommandRequestCountKey =@"maxConcurrentCommandRequestCount"; | 32 | static NSString *const OBSMaxConcurrentCommandRequestCountKey =@"maxConcurrentCommandRequestCount"; |
| @@ -61,6 +62,8 @@ static NSString *const OBSRequestDownloadFilePathKey =@"downloadFileP | @@ -61,6 +62,8 @@ static NSString *const OBSRequestDownloadFilePathKey =@"downloadFileP | ||
| 61 | static NSString *const OBSRequestBackgroundKey =@"background"; | 62 | static NSString *const OBSRequestBackgroundKey =@"background"; |
| 62 | // headesr key; | 63 | // headesr key; |
| 63 | static NSString *const OBSHeadersUAKey =@"User-Agent"; | 64 | static NSString *const OBSHeadersUAKey =@"User-Agent"; |
| 65 | +static NSString *const OBSHeaderErrorCode =@"x-obs-error-code"; | ||
| 66 | +static NSString *const OBSHeaderErrorCodeS3 =@"x-amz-error-code"; | ||
| 64 | 67 | ||
| 65 | static NSString *const OBSHeadersHostKey =@"Host"; | 68 | static NSString *const OBSHeadersHostKey =@"Host"; |
| 66 | static NSString *const OBSHeadersContentTypeKey =@"Content-Type"; | 69 | static NSString *const OBSHeadersContentTypeKey =@"Content-Type"; |
| @@ -171,6 +171,7 @@ | @@ -171,6 +171,7 @@ | ||
| 171 | */ | 171 | */ |
| 172 | @property (nonatomic, assign) OBSProtocolType protocolType; | 172 | @property (nonatomic, assign) OBSProtocolType protocolType; |
| 173 | 173 | ||
| 174 | +@property (nonatomic, strong, nullable) OBSWeakMutableArray *networkingRequestList; | ||
| 174 | 175 | ||
| 175 | /** | 176 | /** |
| 176 | 取消请求 | 177 | 取消请求 |
| @@ -207,6 +208,10 @@ | @@ -207,6 +208,10 @@ | ||
| 207 | 请求ID | 208 | 请求ID |
| 208 | */ | 209 | */ |
| 209 | @property (nonatomic, strong, nullable) NSString *requestID; | 210 | @property (nonatomic, strong, nullable) NSString *requestID; |
| 211 | +/** | ||
| 212 | + 响应原始数据 | ||
| 213 | + */ | ||
| 214 | +@property (nonatomic, strong, nullable) NSMutableData *responseRawData; | ||
| 210 | @end | 215 | @end |
| 211 | 216 | ||
| 212 | 217 |
| @@ -14,6 +14,7 @@ | @@ -14,6 +14,7 @@ | ||
| 14 | #define OBSBaseNetworking_h | 14 | #define OBSBaseNetworking_h |
| 15 | #import "OBSBaseConstDefinition.h" | 15 | #import "OBSBaseConstDefinition.h" |
| 16 | #import "OBSBaseModel.h" | 16 | #import "OBSBaseModel.h" |
| 17 | +#import "OBSCallback.h" | ||
| 17 | @class OBSBFTaskCompletionSource; | 18 | @class OBSBFTaskCompletionSource; |
| 18 | @class OBSBFTask; | 19 | @class OBSBFTask; |
| 19 | @class OBSBaseRequest; | 20 | @class OBSBaseRequest; |
| @@ -67,6 +68,14 @@ | @@ -67,6 +68,14 @@ | ||
| 67 | #pragma mark - Networking Manager | 68 | #pragma mark - Networking Manager |
| 68 | @interface OBSNetworkingManager :NSObject<NSURLSessionDelegate, NSURLSessionTaskDelegate,NSURLSessionDataDelegate,NSURLSessionDownloadDelegate> | 69 | @interface OBSNetworkingManager :NSObject<NSURLSessionDelegate, NSURLSessionTaskDelegate,NSURLSessionDataDelegate,NSURLSessionDownloadDelegate> |
| 69 | @property (nonatomic, readonly, nonnull) OBSBaseConfiguration *configuration; | 70 | @property (nonatomic, readonly, nonnull) OBSBaseConfiguration *configuration; |
| 71 | +@property (nonatomic, strong) NSURLSession *commandURLSession; | ||
| 72 | +@property (nonatomic, strong) NSURLSession *uploadURLSession; | ||
| 73 | +@property (nonatomic, strong) NSURLSession *downloadURLSession; | ||
| 74 | +@property (nonatomic, strong) NSURLSession *backgroundUploadURLSession; | ||
| 75 | +@property (nonatomic, strong) NSURLSession *backgroundDownloadURLSession; | ||
| 76 | +@property (nonatomic, strong) NSOperationQueue *commandURLTaskQueue; | ||
| 77 | +@property (nonatomic, strong) NSOperationQueue *uploadURLTaskQueue; | ||
| 78 | +@property (nonatomic, strong) NSOperationQueue *downloadURLTaskQueue; | ||
| 70 | -(instancetype) initWithConfiguration:(OBSBaseConfiguration*) configuration; | 79 | -(instancetype) initWithConfiguration:(OBSBaseConfiguration*) configuration; |
| 71 | -(OBSBFTask*) sendRequest: (OBSBaseNetworkingRequest*) request; | 80 | -(OBSBFTask*) sendRequest: (OBSBaseNetworkingRequest*) request; |
| 72 | -(void)releaseSessions; | 81 | -(void)releaseSessions; |
| @@ -103,6 +112,8 @@ | @@ -103,6 +112,8 @@ | ||
| 103 | @property (nonatomic, weak, nullable) OBSBaseRequest *obsRequest; | 112 | @property (nonatomic, weak, nullable) OBSBaseRequest *obsRequest; |
| 104 | @property (readonly, nonatomic, assign) BOOL isCancelled; | 113 | @property (readonly, nonatomic, assign) BOOL isCancelled; |
| 105 | -(void)cancel; | 114 | -(void)cancel; |
| 115 | +-(void)addCallbackHeader:(OBSCallback*) callback protocalType:(OBSProtocolType) protocolType; | ||
| 116 | +-(void)addForbidOverwrite:(NSString*) header protocalType:(OBSProtocolType) protocolType; | ||
| 106 | @end | 117 | @end |
| 107 | 118 | ||
| 108 | @interface OBSNetworkingCommandRequest : OBSBaseNetworkingRequest<OBSNetworkingRequestJSONDataProtocol, OBSGetBodyTypeProtocol> | 119 | @interface OBSNetworkingCommandRequest : OBSBaseNetworkingRequest<OBSNetworkingRequestJSONDataProtocol, OBSGetBodyTypeProtocol> |
| 1 | +// | ||
| 2 | +// OBSCallBack.h | ||
| 3 | +// test | ||
| 4 | +// | ||
| 5 | +// Created by ruanhanzhou on 2025/2/14. | ||
| 6 | +// Copyright © 2025 Lprison. All rights reserved. | ||
| 7 | +// | ||
| 8 | +#import "OBSBaseModel.h" | ||
| 9 | +#ifndef OBSCallback_h | ||
| 10 | +#define OBSCallback_h | ||
| 11 | +@interface OBSCallback : OBSBaseEntity | ||
| 12 | +@property (nonatomic, copy, nonnull) NSString * callbackUrl; | ||
| 13 | +@property (nonatomic, copy, nonnull) NSString * callbackBody; | ||
| 14 | +@property (nonatomic, copy, nullable) NSString * callbackHost; | ||
| 15 | +@property (nonatomic, copy, nullable) NSString * callbackBodyType; | ||
| 16 | +-(void) setCallbackUrl:(nonnull NSString * )callbackUrl; | ||
| 17 | +-(void) setCallbackBody:(nonnull NSString * )callbackBody; | ||
| 18 | +- (instancetype) initWithUrl:(nonnull NSString*) callbackUrl | ||
| 19 | + withBody:(nonnull NSString*) callbackBody | ||
| 20 | + withBodyType:(nullable NSString*) callbackBodyType | ||
| 21 | + withHost:(nullable NSString*) callbackHost; | ||
| 22 | + | ||
| 23 | +/** | ||
| 24 | + 获取编码后的callback | ||
| 25 | + */ | ||
| 26 | +-(nullable NSString*) toBase64EncodedJson; | ||
| 27 | +@end | ||
| 28 | +#endif /* OBSCallback_h */ |
| @@ -13,6 +13,7 @@ | @@ -13,6 +13,7 @@ | ||
| 13 | #ifndef OBSClient_h | 13 | #ifndef OBSClient_h |
| 14 | #define OBSClient_h | 14 | #define OBSClient_h |
| 15 | #import "OBSLogging.h" | 15 | #import "OBSLogging.h" |
| 16 | +#import "OBSServiceCredentialProvider.h" | ||
| 16 | 17 | ||
| 17 | @class OBSBaseRequest; | 18 | @class OBSBaseRequest; |
| 18 | @class OBSBFTask; | 19 | @class OBSBFTask; |
| @@ -34,6 +35,15 @@ | @@ -34,6 +35,15 @@ | ||
| 34 | */ | 35 | */ |
| 35 | -(instancetype) initWithConfiguration: (__kindof OBSBaseConfiguration*) configuration; | 36 | -(instancetype) initWithConfiguration: (__kindof OBSBaseConfiguration*) configuration; |
| 36 | 37 | ||
| 38 | +#pragma mark - refresh | ||
| 39 | + | ||
| 40 | +/** | ||
| 41 | + client刷新 | ||
| 42 | + | ||
| 43 | + @param credentialProvider 配置参数 | ||
| 44 | + */ | ||
| 45 | +-(void) refresh: (__kindof OBSStaticCredentialProvider*) credentialProvider error:(NSError**) error; | ||
| 46 | + | ||
| 37 | #pragma mark - set logger | 47 | #pragma mark - set logger |
| 38 | /* *Set log level, default level is info. | 48 | /* *Set log level, default level is info. |
| 39 | log levels are: | 49 | log levels are: |
| @@ -17,6 +17,7 @@ | @@ -17,6 +17,7 @@ | ||
| 17 | #import "OBSServiceBaseModel.h" | 17 | #import "OBSServiceBaseModel.h" |
| 18 | #import "OBSServiceConstDefinition.h" | 18 | #import "OBSServiceConstDefinition.h" |
| 19 | #import "OBSServiceCommonEntities.h" | 19 | #import "OBSServiceCommonEntities.h" |
| 20 | +#import "OBSCallback.h" | ||
| 20 | 21 | ||
| 21 | @class OBSAbstractEncryption; | 22 | @class OBSAbstractEncryption; |
| 22 | //request | 23 | //request |
| @@ -49,6 +50,15 @@ | @@ -49,6 +50,15 @@ | ||
| 49 | 多段任务列表 | 50 | 多段任务列表 |
| 50 | */ | 51 | */ |
| 51 | @property (nonatomic, strong, nonnull) NSMutableArray<OBSPart*> *partsList; | 52 | @property (nonatomic, strong, nonnull) NSMutableArray<OBSPart*> *partsList; |
| 53 | + | ||
| 54 | +/** | ||
| 55 | + 上传回调 | ||
| 56 | + */ | ||
| 57 | +@property (nonatomic, nullable) OBSCallback* callback; | ||
| 58 | +/** | ||
| 59 | + x-obs-forbid-overwrite 头域 | ||
| 60 | + */ | ||
| 61 | +@property (nonatomic, nullable) NSString * forbid_overwrite; | ||
| 52 | @end | 62 | @end |
| 53 | 63 | ||
| 54 | 64 | ||
| @@ -78,6 +88,15 @@ | @@ -78,6 +88,15 @@ | ||
| 78 | @property (nonatomic, strong, nonnull) NSMutableArray<OBSPart*> *partsList; | 88 | @property (nonatomic, strong, nonnull) NSMutableArray<OBSPart*> *partsList; |
| 79 | 89 | ||
| 80 | /** | 90 | /** |
| 91 | + 上传回调 | ||
| 92 | + */ | ||
| 93 | +@property (nonatomic, nullable) OBSCallback* callback; | ||
| 94 | +/** | ||
| 95 | + x-obs-forbid-overwrite 头域 | ||
| 96 | + */ | ||
| 97 | +@property (nonatomic, nullable) NSString * forbid_overwrite; | ||
| 98 | + | ||
| 99 | +/** | ||
| 81 | 初始化合并段request | 100 | 初始化合并段request |
| 82 | 101 | ||
| 83 | @param bucketName 桶名 | 102 | @param bucketName 桶名 |
| @@ -110,6 +110,10 @@ | @@ -110,6 +110,10 @@ | ||
| 110 | 自定义元数据 | 110 | 自定义元数据 |
| 111 | */ | 111 | */ |
| 112 | @property (nonatomic, strong, nullable) NSDictionary *metaDataDict; | 112 | @property (nonatomic, strong, nullable) NSDictionary *metaDataDict; |
| 113 | +/** | ||
| 114 | + x-obs-forbid-overwrite 头域 | ||
| 115 | + */ | ||
| 116 | +@property (nonatomic, nullable) NSString * forbid_overwrite; | ||
| 113 | @end | 117 | @end |
| 114 | 118 | ||
| 115 | 119 | ||
| @@ -205,6 +209,10 @@ | @@ -205,6 +209,10 @@ | ||
| 205 | 自定义MIME类型 | 209 | 自定义MIME类型 |
| 206 | */ | 210 | */ |
| 207 | @property (nonatomic, strong, nonnull) NSString *customContentType; | 211 | @property (nonatomic, strong, nonnull) NSString *customContentType; |
| 212 | +/** | ||
| 213 | + x-obs-forbid-overwrite 头域 | ||
| 214 | + */ | ||
| 215 | +@property (nonatomic, nullable) NSString * forbid_overwrite; | ||
| 208 | 216 | ||
| 209 | /** | 217 | /** |
| 210 | 初始化复制对象request | 218 | 初始化复制对象request |
| @@ -62,6 +62,10 @@ | @@ -62,6 +62,10 @@ | ||
| 62 | MIME类型 | 62 | MIME类型 |
| 63 | */ | 63 | */ |
| 64 | @property (nonatomic, assign) OBSContentType contentType; | 64 | @property (nonatomic, assign) OBSContentType contentType; |
| 65 | +/** | ||
| 66 | + x-obs-forbid-overwrite 头域 | ||
| 67 | + */ | ||
| 68 | +@property (nonatomic, nullable) NSString * forbid_overwrite; | ||
| 65 | 69 | ||
| 66 | @end | 70 | @end |
| 67 | 71 | ||
| @@ -121,6 +125,10 @@ | @@ -121,6 +125,10 @@ | ||
| 121 | 最终映射MIME类型 | 125 | 最终映射MIME类型 |
| 122 | */ | 126 | */ |
| 123 | @property (nonatomic, strong, nonnull) NSString *finalContentType; | 127 | @property (nonatomic, strong, nonnull) NSString *finalContentType; |
| 128 | +/** | ||
| 129 | + x-obs-forbid-overwrite 头域 | ||
| 130 | + */ | ||
| 131 | +@property (nonatomic, nullable) NSString * forbid_overwrite; | ||
| 124 | 132 | ||
| 125 | /** | 133 | /** |
| 126 | 初始化多段上传任务request | 134 | 初始化多段上传任务request |
| 1 | +// | ||
| 2 | +// LocalTimeUtils.h | ||
| 3 | +// test | ||
| 4 | +// | ||
| 5 | +// Created by ruanhanzhou on 2024/9/12. | ||
| 6 | +// Copyright © 2024 Lprison. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#ifndef OBSLocalTimeUtils_h | ||
| 10 | +#define OBSLocalTimeUtils_h | ||
| 11 | +@interface OBSLocalTimeUtils : NSObject | ||
| 12 | ++ (NSDate*) dateWithTimeDiff: (NSDate*) date; | ||
| 13 | ++ (void) setTimeDiffInSecond:(long) timeDiffSecondsInLong; | ||
| 14 | ++ (void) setTimeDiffInSecondFromServerTime:(NSDictionary *) headers | ||
| 15 | + xmlErrorDict:(NSDictionary *) xmlErrorDict; | ||
| 16 | + | ||
| 17 | ++ (Boolean) isAutoRetryEnabled; | ||
| 18 | ++ (void) setIfAutoRetryEnabled:(Boolean) isAutoRetryEnabled; | ||
| 19 | +@end | ||
| 20 | +#endif /* OBSLocalTimeUtils_h */ |
| @@ -13,6 +13,7 @@ | @@ -13,6 +13,7 @@ | ||
| 13 | #import "OBSClient.h" | 13 | #import "OBSClient.h" |
| 14 | #import "OBSServiceBaseModel.h" | 14 | #import "OBSServiceBaseModel.h" |
| 15 | #import "OBSServiceConstDefinition.h" | 15 | #import "OBSServiceConstDefinition.h" |
| 16 | +#import "OBSCallback.h" | ||
| 16 | 17 | ||
| 17 | //request | 18 | //request |
| 18 | @class OBSAbstractEncryption; | 19 | @class OBSAbstractEncryption; |
| @@ -72,6 +73,14 @@ | @@ -72,6 +73,14 @@ | ||
| 72 | MIME类型 | 73 | MIME类型 |
| 73 | */ | 74 | */ |
| 74 | @property (nonatomic, assign) OBSContentType contentType; | 75 | @property (nonatomic, assign) OBSContentType contentType; |
| 76 | +/** | ||
| 77 | + 上传回调 | ||
| 78 | + */ | ||
| 79 | +@property (nonatomic, nullable) OBSCallback* callback; | ||
| 80 | +/** | ||
| 81 | + x-obs-forbid-overwrite 头域 | ||
| 82 | + */ | ||
| 83 | +@property (nonatomic, nullable) NSString * forbid_overwrite; | ||
| 75 | @end | 84 | @end |
| 76 | 85 | ||
| 77 | 86 | ||
| @@ -171,6 +180,15 @@ | @@ -171,6 +180,15 @@ | ||
| 171 | 上传对象时的回调 | 180 | 上传对象时的回调 |
| 172 | */ | 181 | */ |
| 173 | @property (nonatomic, copy, nonnull) OBSNetworkingUploadProgressBlock uploadProgressBlock; | 182 | @property (nonatomic, copy, nonnull) OBSNetworkingUploadProgressBlock uploadProgressBlock; |
| 183 | + | ||
| 184 | +/** | ||
| 185 | + 上传回调 | ||
| 186 | + */ | ||
| 187 | +@property (nonatomic, nullable) OBSCallback* callback; | ||
| 188 | +/** | ||
| 189 | + x-obs-forbid-overwrite 头域 | ||
| 190 | + */ | ||
| 191 | +@property (nonatomic, nullable) NSString * forbid_overwrite; | ||
| 174 | @end | 192 | @end |
| 175 | 193 | ||
| 176 | 194 |
| @@ -38,6 +38,10 @@ static NSString *const OBSCanonicalDateKey_OBS =@"x-obs-date"; | @@ -38,6 +38,10 @@ static NSString *const OBSCanonicalDateKey_OBS =@"x-obs-date"; | ||
| 38 | static NSString *const OBSCanonicalContentSha256Key_OBS =@"x-obs-content-sha256"; | 38 | static NSString *const OBSCanonicalContentSha256Key_OBS =@"x-obs-content-sha256"; |
| 39 | static NSString *const OBSCanonicalRequestIDKey_OBS =@"x-obs-request-id"; | 39 | static NSString *const OBSCanonicalRequestIDKey_OBS =@"x-obs-request-id"; |
| 40 | static NSString *const OBSSTSTokenHeaderKey_OBS =@"x-obs-security-token"; | 40 | static NSString *const OBSSTSTokenHeaderKey_OBS =@"x-obs-security-token"; |
| 41 | +static NSString *const OBSCallbackHeaderKey_OBS =@"x-obs-callback"; | ||
| 42 | +static NSString *const OBSCallbackHeaderKey_V2 =@"x-amz-callback"; | ||
| 43 | +static NSString *const OBSForbidOverwrite_OBS =@"x-obs-forbid-overwrite"; | ||
| 44 | +static NSString *const OBSForbidOverwrite_V2 =@"x-amz-forbid-overwrite"; | ||
| 41 | static NSString *const OBSServiceName_OBS =@"s3"; | 45 | static NSString *const OBSServiceName_OBS =@"s3"; |
| 42 | 46 | ||
| 43 | static NSString *const OBSEncryptionKMSKey =@"aws:kms"; | 47 | static NSString *const OBSEncryptionKMSKey =@"aws:kms"; |
| @@ -37,7 +37,8 @@ | @@ -37,7 +37,8 @@ | ||
| 37 | @property (nonatomic, assign) OBSAuthVersion authVersion; | 37 | @property (nonatomic, assign) OBSAuthVersion authVersion; |
| 38 | @property (nonatomic, assign) OBSProtocolType protocolType; | 38 | @property (nonatomic, assign) OBSProtocolType protocolType; |
| 39 | @property (nonatomic, strong, nonnull) NSString *securityToken; | 39 | @property (nonatomic, strong, nonnull) NSString *securityToken; |
| 40 | -@property (nonatomic,assign) BOOL isGetProtocol; | 40 | +@property (nonatomic, assign) NSTimeInterval timeOffset; |
| 41 | +@property (nonatomic, assign) BOOL isGetProtocol; | ||
| 41 | 42 | ||
| 42 | /** | 43 | /** |
| 43 | 使用AccessKey初始化凭证 默认采用V2鉴权 | 44 | 使用AccessKey初始化凭证 默认采用V2鉴权 |
| @@ -13,6 +13,7 @@ | @@ -13,6 +13,7 @@ | ||
| 13 | #import "OBSClient.h" | 13 | #import "OBSClient.h" |
| 14 | #import "OBSServiceBaseModel.h" | 14 | #import "OBSServiceBaseModel.h" |
| 15 | #import "OBSServiceConstDefinition.h" | 15 | #import "OBSServiceConstDefinition.h" |
| 16 | +#import "OBSCallback.h" | ||
| 16 | @class OBSAbstractEncryption; | 17 | @class OBSAbstractEncryption; |
| 17 | 18 | ||
| 18 | #pragma mark - request | 19 | #pragma mark - request |
| @@ -98,6 +99,15 @@ | @@ -98,6 +99,15 @@ | ||
| 98 | */ | 99 | */ |
| 99 | @property (nonatomic, assign) OBSContentType contentType; | 100 | @property (nonatomic, assign) OBSContentType contentType; |
| 100 | 101 | ||
| 102 | +/** | ||
| 103 | + 上传回调 | ||
| 104 | + */ | ||
| 105 | +@property (nonatomic, nullable) OBSCallback* callback; | ||
| 106 | +/** | ||
| 107 | + x-obs-forbid-overwrite 头域 | ||
| 108 | + */ | ||
| 109 | +@property (nonatomic, nullable) NSString * forbid_overwrite; | ||
| 110 | + | ||
| 101 | @end | 111 | @end |
| 102 | 112 | ||
| 103 | 113 | ||
| @@ -198,6 +208,27 @@ | @@ -198,6 +208,27 @@ | ||
| 198 | @property (nonatomic, strong, nonnull) NSString *finalContentType; | 208 | @property (nonatomic, strong, nonnull) NSString *finalContentType; |
| 199 | 209 | ||
| 200 | /** | 210 | /** |
| 211 | + 通过cancel方法暂停上传后,是否自动取消断点续传任务,并且删除本地记录上传进度的文件 | ||
| 212 | + */ | ||
| 213 | +@property (nonatomic, assign) BOOL needAbortUploadFileAfterCancel; | ||
| 214 | + | ||
| 215 | +/** | ||
| 216 | + 断点续传上传中分段上传任务的失败后重试间隔(单位ms) | ||
| 217 | + */ | ||
| 218 | +@property (nonatomic, assign) NSInteger uploadPartRetryIntervalMs; | ||
| 219 | +/** | ||
| 220 | + 断点续传上传中每个分段上传任务的最大重试次数 | ||
| 221 | + */ | ||
| 222 | +@property (nonatomic, assign) NSInteger maxUploadPartRetryCount; | ||
| 223 | +/** | ||
| 224 | + 上传回调 | ||
| 225 | + */ | ||
| 226 | +@property (nonatomic, nullable) OBSCallback* callback; | ||
| 227 | +/** | ||
| 228 | + x-obs-forbid-overwrite 头域 | ||
| 229 | + */ | ||
| 230 | +@property (nonatomic, nullable) NSString * forbid_overwrite; | ||
| 231 | +/** | ||
| 201 | 初始化断点续传request | 232 | 初始化断点续传request |
| 202 | 233 | ||
| 203 | @param bucketName 桶名 | 234 | @param bucketName 桶名 |
No preview for this file type
No preview for this file type
| @@ -45,6 +45,9 @@ private struct RunnerLaunchView: View { | @@ -45,6 +45,9 @@ private struct RunnerLaunchView: View { | ||
| 45 | SplashView() | 45 | SplashView() |
| 46 | .onAppear(perform: startIfNeeded) | 46 | .onAppear(perform: startIfNeeded) |
| 47 | } | 47 | } |
| 48 | + } | ||
| 49 | + .onAppear { | ||
| 50 | + appDelegate.setup() | ||
| 48 | }.onOpenURL { url in | 51 | }.onOpenURL { url in |
| 49 | appDelegate.handleFlutterUrl(url.absoluteString) | 52 | appDelegate.handleFlutterUrl(url.absoluteString) |
| 50 | } | 53 | } |
-
Please register or login to post a comment