first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

57
node_modules/expo-keep-awake/ios/KeepAwakeModule.swift generated vendored Normal file
View File

@@ -0,0 +1,57 @@
// Copyright 2021-present 650 Industries. All rights reserved.
import ExpoModulesCore
public final class KeepAwakeModule: Module {
private var activeTags = Set<String>()
public func definition() -> ModuleDefinition {
Name("ExpoKeepAwake")
AsyncFunction("activate") { (tag: String) -> Bool in
if self.activeTags.isEmpty {
setActivated(true)
}
self.activeTags.insert(tag)
return true
}
AsyncFunction("deactivate") { (tag: String) -> Bool in
self.activeTags.remove(tag)
if self.activeTags.isEmpty {
setActivated(false)
}
return true
}
AsyncFunction("isActivated") { () -> Bool in
#if os(iOS) || os(tvOS)
return DispatchQueue.main.sync {
return UIApplication.shared.isIdleTimerDisabled
}
#elseif os(macOS)
return false
#endif
}
OnAppEntersForeground {
if !self.activeTags.isEmpty {
setActivated(true)
}
}
OnAppEntersBackground {
if !self.activeTags.isEmpty {
setActivated(false)
}
}
}
}
private func setActivated(_ activated: Bool) {
#if os(iOS) || os(tvOS)
DispatchQueue.main.async {
UIApplication.shared.isIdleTimerDisabled = activated
}
#endif
}