expo-keep-awake 10.2.0 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,18 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 11.0.0 — 2022-10-06
14
+
15
+ ### 🛠 Breaking changes
16
+
17
+ - Bumped iOS deployment target to 13.0 and deprecated support for iOS 12. ([#18873](https://github.com/expo/expo/pull/18873) by [@tsapeta](https://github.com/tsapeta))
18
+
19
+ ## 10.2.1 — 2022-08-08
20
+
21
+ ### 🐛 Bug fixes
22
+
23
+ - Attempt to fix `EXC_BAD_ACCESS` and `NSInvalidArgumentException` crashes by not referencing to the class instance function. ([#18553](https://github.com/expo/expo/pull/18553) by [@tsapeta](https://github.com/tsapeta))
24
+
13
25
  ## 10.2.0 — 2022-07-07
14
26
 
15
27
  ### 🐛 Bug fixes
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '10.2.0'
6
+ version = '11.0.0'
7
7
 
8
8
  buildscript {
9
9
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
@@ -74,7 +74,7 @@ android {
74
74
  minSdkVersion safeExtGet("minSdkVersion", 21)
75
75
  targetSdkVersion safeExtGet("targetSdkVersion", 31)
76
76
  versionCode 16
77
- versionName "10.2.0"
77
+ versionName "11.0.0"
78
78
  }
79
79
  lintOptions {
80
80
  abortOnError false
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
10
10
  s.license = package['license']
11
11
  s.author = package['author']
12
12
  s.homepage = package['homepage']
13
- s.platform = :ios, '12.0'
13
+ s.platform = :ios, '13.0'
14
14
  s.swift_version = '5.4'
15
15
  s.source = { git: 'https://github.com/expo/expo.git' }
16
16
  s.static_framework = true
@@ -8,42 +8,39 @@ public final class KeepAwakeModule: Module {
8
8
  public func definition() -> ModuleDefinition {
9
9
  Name("ExpoKeepAwake")
10
10
 
11
- AsyncFunction("activate", activate)
12
- AsyncFunction("deactivate", deactivate)
13
- AsyncFunction("isActivated", isActivated)
14
-
15
- OnAppEntersForeground {
16
- if !self.activeTags.isEmpty {
11
+ AsyncFunction("activate") { (tag: String) -> Bool in
12
+ if self.activeTags.isEmpty {
17
13
  setActivated(true)
18
14
  }
15
+ self.activeTags.insert(tag)
16
+ return true
19
17
  }
20
- OnAppEntersBackground {
21
- if !self.activeTags.isEmpty {
18
+
19
+ AsyncFunction("deactivate") { (tag: String) -> Bool in
20
+ self.activeTags.remove(tag)
21
+ if self.activeTags.isEmpty {
22
22
  setActivated(false)
23
23
  }
24
+ return true
24
25
  }
25
- }
26
26
 
27
- private func activate(tag: String) -> Bool {
28
- if activeTags.isEmpty {
29
- setActivated(true)
27
+ AsyncFunction("isActivated") { () -> Bool in
28
+ return DispatchQueue.main.sync {
29
+ return UIApplication.shared.isIdleTimerDisabled
30
+ }
30
31
  }
31
- activeTags.insert(tag)
32
- return true
33
- }
34
32
 
35
- private func deactivate(tag: String) -> Bool {
36
- activeTags.remove(tag)
37
- if activeTags.isEmpty {
38
- setActivated(false)
33
+ OnAppEntersForeground {
34
+ if !self.activeTags.isEmpty {
35
+ setActivated(true)
36
+ }
39
37
  }
40
- return true
41
- }
42
- }
43
38
 
44
- private func isActivated() -> Bool {
45
- return DispatchQueue.main.sync {
46
- return UIApplication.shared.isIdleTimerDisabled
39
+ OnAppEntersBackground {
40
+ if !self.activeTags.isEmpty {
41
+ setActivated(false)
42
+ }
43
+ }
47
44
  }
48
45
  }
49
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-keep-awake",
3
- "version": "10.2.0",
3
+ "version": "11.0.0",
4
4
  "description": "Provides a React component that prevents the screen sleeping when rendered. It also exposes static methods to control the behavior imperatively.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -42,5 +42,5 @@
42
42
  "jest": {
43
43
  "preset": "expo-module-scripts"
44
44
  },
45
- "gitHead": "e893ff2b01e108cf246cec02318c0df9d6bc603c"
45
+ "gitHead": "1327fe2bc92f71f7213cd5ddd40fa4f8a5336bc6"
46
46
  }