expo-keep-awake 10.2.0 → 10.2.1
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 +6 -0
- package/android/build.gradle +2 -2
- package/ios/KeepAwakeModule.swift +22 -25
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 10.2.1 — 2022-08-08
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- 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))
|
|
18
|
+
|
|
13
19
|
## 10.2.0 — 2022-07-07
|
|
14
20
|
|
|
15
21
|
### 🐛 Bug fixes
|
package/android/build.gradle
CHANGED
|
@@ -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.
|
|
6
|
+
version = '10.2.1'
|
|
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.
|
|
77
|
+
versionName "10.2.1"
|
|
78
78
|
}
|
|
79
79
|
lintOptions {
|
|
80
80
|
abortOnError false
|
|
@@ -8,42 +8,39 @@ public final class KeepAwakeModule: Module {
|
|
|
8
8
|
public func definition() -> ModuleDefinition {
|
|
9
9
|
Name("ExpoKeepAwake")
|
|
10
10
|
|
|
11
|
-
AsyncFunction("activate"
|
|
12
|
-
|
|
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
|
-
|
|
21
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
OnAppEntersForeground {
|
|
34
|
+
if !self.activeTags.isEmpty {
|
|
35
|
+
setActivated(true)
|
|
36
|
+
}
|
|
39
37
|
}
|
|
40
|
-
return true
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
38
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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.
|
|
3
|
+
"version": "10.2.1",
|
|
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": "
|
|
45
|
+
"gitHead": "38e4349fbebadadffe28bd8e800f527a7a2a50fa"
|
|
46
46
|
}
|