From 12b7f979109a91af65a151be47bf65c602aa6e1c Mon Sep 17 00:00:00 2001 From: creativecreatorormaybenot Date: Tue, 14 Sep 2021 01:03:23 +0000 Subject: [PATCH] Fix wakelock on iOS (#143) * Update CHANGELOG * Fix wakelock on iOS --- wakelock/CHANGELOG.md | 4 + wakelock/example/ios/.gitignore | 1 + .../ios/Flutter/AppFrameworkInfo.plist | 2 +- wakelock/example/ios/Flutter/Debug.xcconfig | 2 +- wakelock/example/ios/Flutter/Release.xcconfig | 2 +- wakelock/example/ios/Podfile.lock | 8 +- .../ios/Runner.xcodeproj/project.pbxproj | 92 +++++++------------ wakelock/example/ios/Runner/AppDelegate.h | 6 -- wakelock/example/ios/Runner/AppDelegate.m | 13 --- wakelock/example/ios/Runner/AppDelegate.swift | 13 +++ .../ios/Runner/Runner-Bridging-Header.h | 1 + wakelock/example/ios/Runner/main.m | 9 -- wakelock/ios/Classes/WakelockPlugin.m | 4 +- wakelock/pubspec.yaml | 2 +- 14 files changed, 63 insertions(+), 96 deletions(-) delete mode 100644 wakelock/example/ios/Runner/AppDelegate.h delete mode 100644 wakelock/example/ios/Runner/AppDelegate.m create mode 100644 wakelock/example/ios/Runner/AppDelegate.swift create mode 100644 wakelock/example/ios/Runner/Runner-Bridging-Header.h delete mode 100644 wakelock/example/ios/Runner/main.m diff --git a/wakelock/CHANGELOG.md b/wakelock/CHANGELOG.md index 9c0e52e4..a7972529 100644 --- a/wakelock/CHANGELOG.md +++ b/wakelock/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.5 + +* Fixed iOS API by updating the method signatures to match the newly generated protocol. + ## 0.5.4 * Upgraded `pigeon` and lints. diff --git a/wakelock/example/ios/.gitignore b/wakelock/example/ios/.gitignore index e96ef602..151026b9 100644 --- a/wakelock/example/ios/.gitignore +++ b/wakelock/example/ios/.gitignore @@ -18,6 +18,7 @@ Flutter/App.framework Flutter/Flutter.framework Flutter/Flutter.podspec Flutter/Generated.xcconfig +Flutter/ephemeral/ Flutter/app.flx Flutter/app.zip Flutter/flutter_assets/ diff --git a/wakelock/example/ios/Flutter/AppFrameworkInfo.plist b/wakelock/example/ios/Flutter/AppFrameworkInfo.plist index f2872cf4..8d4492f9 100644 --- a/wakelock/example/ios/Flutter/AppFrameworkInfo.plist +++ b/wakelock/example/ios/Flutter/AppFrameworkInfo.plist @@ -3,7 +3,7 @@ CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) + en CFBundleExecutable App CFBundleIdentifier diff --git a/wakelock/example/ios/Flutter/Debug.xcconfig b/wakelock/example/ios/Flutter/Debug.xcconfig index e8efba11..ec97fc6f 100644 --- a/wakelock/example/ios/Flutter/Debug.xcconfig +++ b/wakelock/example/ios/Flutter/Debug.xcconfig @@ -1,2 +1,2 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/wakelock/example/ios/Flutter/Release.xcconfig b/wakelock/example/ios/Flutter/Release.xcconfig index 399e9340..c4855bfe 100644 --- a/wakelock/example/ios/Flutter/Release.xcconfig +++ b/wakelock/example/ios/Flutter/Release.xcconfig @@ -1,2 +1,2 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/wakelock/example/ios/Podfile.lock b/wakelock/example/ios/Podfile.lock index 1e57dbf2..37a3171b 100644 --- a/wakelock/example/ios/Podfile.lock +++ b/wakelock/example/ios/Podfile.lock @@ -19,10 +19,10 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/wakelock/ios" SPEC CHECKSUMS: - Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c - integration_test: 5ed24a436eb7ec17b6a13046e9bf7ca4a404e59e + Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a + integration_test: 7db6d89f336f671dcbc7563ee27a5b08f6f8aee1 wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f -PODFILE CHECKSUM: 8e679eca47255a8ca8067c4c67aab20e64cb974d +PODFILE CHECKSUM: da6cafc552cabecbcfc14b81246265fade7d4e24 -COCOAPODS: 1.10.1 +COCOAPODS: 1.10.2 diff --git a/wakelock/example/ios/Runner.xcodeproj/project.pbxproj b/wakelock/example/ios/Runner.xcodeproj/project.pbxproj index 1270529a..9b5e578e 100644 --- a/wakelock/example/ios/Runner.xcodeproj/project.pbxproj +++ b/wakelock/example/ios/Runner.xcodeproj/project.pbxproj @@ -9,12 +9,11 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - A6847046D3B647529A66EE97 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 320D1841761F9CD1E849A1F0 /* libPods-Runner.a */; }; + BFCC9E3CB7BA279741FCD992 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BD8D23A744CDD45E828295B8 /* libPods-Runner.a */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -31,24 +30,23 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 06B046091A6718E60BC8F2E0 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 2111AD0340E57F623E74EE98 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 320D1841761F9CD1E849A1F0 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 6937DE1C1E231CE26C21EB6B /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - F6CC63182AFEEC23EAC5C95F /* 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 = ""; }; + A3A052DAD735CA9CF9731DD7 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + AA5F285A86624788771EA287 /* 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 = ""; }; + BD8D23A744CDD45E828295B8 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -56,27 +54,27 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A6847046D3B647529A66EE97 /* libPods-Runner.a in Frameworks */, + BFCC9E3CB7BA279741FCD992 /* libPods-Runner.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 356EF92E5865B0B43E707F28 /* Frameworks */ = { + 4AB0E97870F5F2117E1F7CA1 /* Frameworks */ = { isa = PBXGroup; children = ( - 320D1841761F9CD1E849A1F0 /* libPods-Runner.a */, + BD8D23A744CDD45E828295B8 /* libPods-Runner.a */, ); name = Frameworks; sourceTree = ""; }; - 7865595A245EC8291D1003FA /* Pods */ = { + 6CEE6E211895A0B70D51FC97 /* Pods */ = { isa = PBXGroup; children = ( - F6CC63182AFEEC23EAC5C95F /* Pods-Runner.debug.xcconfig */, - 2111AD0340E57F623E74EE98 /* Pods-Runner.release.xcconfig */, - 6937DE1C1E231CE26C21EB6B /* Pods-Runner.profile.xcconfig */, + AA5F285A86624788771EA287 /* Pods-Runner.debug.xcconfig */, + A3A052DAD735CA9CF9731DD7 /* Pods-Runner.release.xcconfig */, + 06B046091A6718E60BC8F2E0 /* Pods-Runner.profile.xcconfig */, ); name = Pods; path = Pods; @@ -99,8 +97,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - 7865595A245EC8291D1003FA /* Pods */, - 356EF92E5865B0B43E707F28 /* Frameworks */, + 6CEE6E211895A0B70D51FC97 /* Pods */, + 4AB0E97870F5F2117E1F7CA1 /* Frameworks */, ); sourceTree = ""; }; @@ -115,27 +113,18 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, ); path = Runner; sourceTree = ""; }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -143,7 +132,7 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 112EA101BE908B08DE569906 /* [CP] Check Pods Manifest.lock */, + 074E7DABAAA7AEDC614E5B1B /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, @@ -171,6 +160,7 @@ TargetAttributes = { 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; }; }; }; @@ -207,7 +197,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 112EA101BE908B08DE569906 /* [CP] Check Pods Manifest.lock */ = { + 074E7DABAAA7AEDC614E5B1B /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -264,8 +254,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -347,20 +336,15 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); PRODUCT_BUNDLE_IDENTIFIER = creativemaybeno.wakelockExample; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Profile; @@ -465,6 +449,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -475,20 +460,16 @@ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); PRODUCT_BUNDLE_IDENTIFIER = creativemaybeno.wakelockExample; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; @@ -498,20 +479,15 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); PRODUCT_BUNDLE_IDENTIFIER = creativemaybeno.wakelockExample; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Release; diff --git a/wakelock/example/ios/Runner/AppDelegate.h b/wakelock/example/ios/Runner/AppDelegate.h deleted file mode 100644 index 36e21bbf..00000000 --- a/wakelock/example/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,6 +0,0 @@ -#import -#import - -@interface AppDelegate : FlutterAppDelegate - -@end diff --git a/wakelock/example/ios/Runner/AppDelegate.m b/wakelock/example/ios/Runner/AppDelegate.m deleted file mode 100644 index 70e83933..00000000 --- a/wakelock/example/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,13 +0,0 @@ -#import "AppDelegate.h" -#import "GeneratedPluginRegistrant.h" - -@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]; -} - -@end diff --git a/wakelock/example/ios/Runner/AppDelegate.swift b/wakelock/example/ios/Runner/AppDelegate.swift new file mode 100644 index 00000000..70693e4a --- /dev/null +++ b/wakelock/example/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/wakelock/example/ios/Runner/Runner-Bridging-Header.h b/wakelock/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 00000000..308a2a56 --- /dev/null +++ b/wakelock/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/wakelock/example/ios/Runner/main.m b/wakelock/example/ios/Runner/main.m deleted file mode 100644 index dff6597e..00000000 --- a/wakelock/example/ios/Runner/main.m +++ /dev/null @@ -1,9 +0,0 @@ -#import -#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/wakelock/ios/Classes/WakelockPlugin.m b/wakelock/ios/Classes/WakelockPlugin.m index 6f7d05b1..a2d12c8e 100644 --- a/wakelock/ios/Classes/WakelockPlugin.m +++ b/wakelock/ios/Classes/WakelockPlugin.m @@ -17,7 +17,7 @@ + (void)registerWithRegistrar:(NSObject*)registrar { [[IdleTimerDisabledObserver singleInstance] beginObserving]; } -- (void)toggle:(FLTToggleMessage*)input error:(FlutterError**)error { +- (void)toggleMsg:(FLTToggleMessage*)input error:(FlutterError**)error { NSNumber *enable = input.enable; self.enable = enable.boolValue; NSNumber *enabled = [NSNumber numberWithBool:[[UIApplication sharedApplication] isIdleTimerDisabled]]; @@ -27,7 +27,7 @@ - (void)toggle:(FLTToggleMessage*)input error:(FlutterError**)error { } } -- (FLTIsEnabledMessage*)isEnabled:(FlutterError* __autoreleasing *)error { +- (FLTIsEnabledMessage*)isEnabledWithError:(FlutterError* __autoreleasing *)error { NSNumber *enabled = [NSNumber numberWithBool:[[UIApplication sharedApplication] isIdleTimerDisabled]]; FLTIsEnabledMessage* result = [[FLTIsEnabledMessage alloc] init]; diff --git a/wakelock/pubspec.yaml b/wakelock/pubspec.yaml index 071d781d..f5e41954 100644 --- a/wakelock/pubspec.yaml +++ b/wakelock/pubspec.yaml @@ -2,7 +2,7 @@ name: wakelock description: >-2 Plugin that allows you to keep the device screen awake, i.e. prevent the screen from sleeping on Android, iOS, macOS, Windows, and web. -version: 0.5.4 +version: 0.5.5 repository: https://github.com/creativecreatorormaybenot/wakelock/tree/main/wakelock environment: