react-native-asleep 0.0.2
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/.eslintrc.js +5 -0
- package/License.md +117 -0
- package/README.md +36 -0
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build.gradle +77 -0
- package/android/libs/AsleepSDK.aar +0 -0
- package/android/src/main/AndroidManifest.xml +26 -0
- package/android/src/main/aidl/ai/asleep/reactnative/IAsleepService.aidl +9 -0
- package/android/src/main/aidl/ai/asleep/reactnative/IListener.aidl +12 -0
- package/android/src/main/aidl/ai/asleep/reactnative/data/ErrorCode.aidl +4 -0
- package/android/src/main/java/ai/asleep/reactnative/AsleepModule.kt +396 -0
- package/android/src/main/java/ai/asleep/reactnative/data/ErrorCode.kt +33 -0
- package/android/src/main/java/ai/asleep/reactnative/service/AsleepService.kt +179 -0
- package/android/src/main/java/ai/asleep/reactnative/service/AsleepViewModel.kt +246 -0
- package/android/src/main/java/ai/asleep/reactnative/utils/PreferenceHelper.kt +119 -0
- package/android/src/main/java/ai/asleep/reactnative/utils/Utils.kt +48 -0
- package/build/Asleep.types.d.ts +90 -0
- package/build/Asleep.types.d.ts.map +1 -0
- package/build/Asleep.types.js +2 -0
- package/build/Asleep.types.js.map +1 -0
- package/build/AsleepModule.d.ts +3 -0
- package/build/AsleepModule.d.ts.map +1 -0
- package/build/AsleepModule.js +3 -0
- package/build/AsleepModule.js.map +1 -0
- package/expo-module.config.json +9 -0
- package/index.ts +352 -0
- package/ios/Asleep.podspec +23 -0
- package/ios/AsleepModule.swift +202 -0
- package/package.json +42 -0
- package/src/Asleep.types.ts +87 -0
- package/src/AsleepModule.ts +3 -0
- package/tsconfig.json +9 -0
package/.eslintrc.js
ADDED
package/License.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
Asleep SDK
|
|
2
|
+
Copyright © 2023 ASLEEP All rights reserved.
|
|
3
|
+
|
|
4
|
+
Unauthorized use, modification and redistribution of this software are strongly prohibited.
|
|
5
|
+
|
|
6
|
+
This software contains subcomponents with separate copyright notices and license terms.
|
|
7
|
+
Your use of the source code for these subcomponents is subject to the terms and conditions of the following licenses.
|
|
8
|
+
|
|
9
|
+
=====
|
|
10
|
+
Android SDK
|
|
11
|
+
|
|
12
|
+
Apache License
|
|
13
|
+
Version 2.0, January 2004
|
|
14
|
+
http://www.apache.org/licenses/
|
|
15
|
+
|
|
16
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
17
|
+
you may not use this file except in compliance with the License.
|
|
18
|
+
You may obtain a copy of the License at
|
|
19
|
+
|
|
20
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
21
|
+
|
|
22
|
+
Unless required by applicable law or agreed to in writing, software
|
|
23
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
24
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
25
|
+
See the License for the specific language governing permissions and
|
|
26
|
+
limitations under the License.
|
|
27
|
+
|
|
28
|
+
=====
|
|
29
|
+
JetBrains/kotlin
|
|
30
|
+
|
|
31
|
+
Apache License
|
|
32
|
+
Version 2.0, January 2004
|
|
33
|
+
http://www.apache.org/licenses/
|
|
34
|
+
|
|
35
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
36
|
+
you may not use this file except in compliance with the License.
|
|
37
|
+
You may obtain a copy of the License at
|
|
38
|
+
|
|
39
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
40
|
+
|
|
41
|
+
Unless required by applicable law or agreed to in writing, software
|
|
42
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
43
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
44
|
+
See the License for the specific language governing permissions and
|
|
45
|
+
limitations under the License.
|
|
46
|
+
|
|
47
|
+
=====
|
|
48
|
+
Gson (26.0-android) - Apache-2.0
|
|
49
|
+
|
|
50
|
+
Apache License
|
|
51
|
+
Version 2.0, January 2004
|
|
52
|
+
http://www.apache.org/licenses/
|
|
53
|
+
|
|
54
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
55
|
+
you may not use this file except in compliance with the License.
|
|
56
|
+
You may obtain a copy of the License at
|
|
57
|
+
|
|
58
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
59
|
+
|
|
60
|
+
Unless required by applicable law or agreed to in writing, software
|
|
61
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
62
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
63
|
+
See the License for the specific language governing permissions and
|
|
64
|
+
limitations under the License.
|
|
65
|
+
|
|
66
|
+
=====
|
|
67
|
+
okhttp (4.9.0) - The Apache Software License, Version 2.0
|
|
68
|
+
Apache License
|
|
69
|
+
Version 2.0, January 2004
|
|
70
|
+
http://www.apache.org/licenses/
|
|
71
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
72
|
+
you may not use this file except in compliance with the License.
|
|
73
|
+
You may obtain a copy of the License at
|
|
74
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
75
|
+
Unless required by applicable law or agreed to in writing, software
|
|
76
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
77
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
78
|
+
See the License for the specific language governing permissions and
|
|
79
|
+
limitations under the License.
|
|
80
|
+
=====
|
|
81
|
+
Okio (2.10.0) - The Apache Software License, Version 2.0
|
|
82
|
+
|
|
83
|
+
Apache License
|
|
84
|
+
Version 2.0, January 2004
|
|
85
|
+
http://www.apache.org/licenses/
|
|
86
|
+
|
|
87
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
88
|
+
you may not use this file except in compliance with the License.
|
|
89
|
+
You may obtain a copy of the License at
|
|
90
|
+
|
|
91
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
92
|
+
|
|
93
|
+
Unless required by applicable law or agreed to in writing, software
|
|
94
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
95
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
96
|
+
See the License for the specific language governing permissions and
|
|
97
|
+
limitations under the License.
|
|
98
|
+
|
|
99
|
+
=====
|
|
100
|
+
npy (0.3.5) - MIT License
|
|
101
|
+
Copyright (c) 2016-2018 JetBrains BioLabs
|
|
102
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
103
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
104
|
+
in the Software without restriction, including without limitation the rights
|
|
105
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
106
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
107
|
+
furnished to do so, subject to the following conditions:
|
|
108
|
+
The above copyright notice and this permission notice shall be included in
|
|
109
|
+
all copies or substantial portions of the Software.
|
|
110
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
111
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
112
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
113
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
114
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
115
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
116
|
+
THE SOFTWARE.
|
|
117
|
+
=====
|
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# ⚠️ Experimental Version - Not Recommended for Production Use
|
|
2
|
+
|
|
3
|
+
# This is an experimental version of the SDK and is not recommended for production use. Please be aware that it may contain bugs and breaking changes.
|
|
4
|
+
|
|
5
|
+
# react-native-asleep
|
|
6
|
+
|
|
7
|
+
Asleep SDK for React Native
|
|
8
|
+
|
|
9
|
+
# API documentation
|
|
10
|
+
|
|
11
|
+
- [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/react-native-asleep.md)
|
|
12
|
+
- [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/react-native-asleep/)
|
|
13
|
+
|
|
14
|
+
# Installation in managed Expo projects
|
|
15
|
+
|
|
16
|
+
For [managed](https://docs.expo.dev/archive/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](#api-documentation). If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.
|
|
17
|
+
|
|
18
|
+
# Installation in bare React Native projects
|
|
19
|
+
|
|
20
|
+
For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.
|
|
21
|
+
|
|
22
|
+
### Add the package to your npm dependencies
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
npm install react-native-asleep
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Configure for iOS
|
|
29
|
+
|
|
30
|
+
Run `npx pod-install` after installing the npm package.
|
|
31
|
+
|
|
32
|
+
### Configure for Android
|
|
33
|
+
|
|
34
|
+
# Contributing
|
|
35
|
+
|
|
36
|
+
Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing).
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
File without changes
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
repositories {
|
|
3
|
+
google()
|
|
4
|
+
mavenCentral()
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
apply plugin: 'com.android.library'
|
|
9
|
+
apply plugin: 'org.jetbrains.kotlin.android'
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
group = 'ai.asleep.reactnative'
|
|
13
|
+
version = '2.4.3'
|
|
14
|
+
|
|
15
|
+
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
16
|
+
apply from: expoModulesCorePlugin
|
|
17
|
+
applyKotlinExpoModulesCorePlugin()
|
|
18
|
+
useCoreDependencies()
|
|
19
|
+
useExpoPublishing()
|
|
20
|
+
|
|
21
|
+
// If you want to use the managed Android SDK versions from expo-modules-core, set this to true.
|
|
22
|
+
// The Android SDK versions will be bumped from time to time in SDK releases and may introduce breaking changes in your module code.
|
|
23
|
+
// Most of the time, you may like to manage the Android SDK versions yourself.
|
|
24
|
+
def useManagedAndroidSdkVersions = false
|
|
25
|
+
if (useManagedAndroidSdkVersions) {
|
|
26
|
+
useDefaultAndroidSdkVersions()
|
|
27
|
+
} else {
|
|
28
|
+
buildscript {
|
|
29
|
+
// Simple helper that allows the root project to override versions declared by this library.
|
|
30
|
+
ext.safeExtGet = { prop, fallback ->
|
|
31
|
+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
project.android {
|
|
35
|
+
compileSdkVersion safeExtGet("compileSdkVersion", 34)
|
|
36
|
+
defaultConfig {
|
|
37
|
+
minSdkVersion safeExtGet("minSdkVersion", 24)
|
|
38
|
+
targetSdkVersion safeExtGet("targetSdkVersion", 34)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
android {
|
|
44
|
+
namespace "ai.asleep.reactnative"
|
|
45
|
+
defaultConfig {
|
|
46
|
+
versionCode 1
|
|
47
|
+
versionName "2.4.3"
|
|
48
|
+
}
|
|
49
|
+
lintOptions {
|
|
50
|
+
abortOnError false
|
|
51
|
+
}
|
|
52
|
+
sourceSets {
|
|
53
|
+
main {
|
|
54
|
+
aidl.srcDirs = ['src/main/aidl']
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
buildFeatures {
|
|
58
|
+
aidl true
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
repositories {
|
|
63
|
+
flatDir {
|
|
64
|
+
dirs 'libs'
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
dependencies {
|
|
69
|
+
implementation fileTree(dir: 'libs', include: ['*.aar'])
|
|
70
|
+
compileOnly(name: 'AsleepSDK', ext: 'aar')
|
|
71
|
+
implementation 'com.facebook.react:react-native:+'
|
|
72
|
+
implementation 'com.google.code.gson:gson:2.8.9'
|
|
73
|
+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0"
|
|
74
|
+
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.0"
|
|
75
|
+
implementation "androidx.lifecycle:lifecycle-service:2.7.0"
|
|
76
|
+
implementation "androidx.lifecycle:lifecycle-common-java8:2.7.0"
|
|
77
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ai.asleep.reactnative">
|
|
3
|
+
<uses-permission android:name="android.permission.INTERNET" />
|
|
4
|
+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
5
|
+
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
|
6
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
7
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE"/>
|
|
8
|
+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
|
9
|
+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
|
10
|
+
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
|
|
11
|
+
|
|
12
|
+
<application>
|
|
13
|
+
|
|
14
|
+
<service
|
|
15
|
+
android:name=".service.AsleepService"
|
|
16
|
+
android:enabled="true"
|
|
17
|
+
android:exported="false"
|
|
18
|
+
android:process=":RecordingService"
|
|
19
|
+
android:foregroundServiceType="microphone"
|
|
20
|
+
android:stopWithTask="false">
|
|
21
|
+
<intent-filter>
|
|
22
|
+
<action android:name="ai.asleep.reactnative.IAsleepService" />
|
|
23
|
+
</intent-filter>
|
|
24
|
+
</service>
|
|
25
|
+
</application>
|
|
26
|
+
</manifest>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// IListener.aidl
|
|
2
|
+
package ai.asleep.reactnative;
|
|
3
|
+
|
|
4
|
+
import ai.asleep.reactnative.data.ErrorCode;
|
|
5
|
+
|
|
6
|
+
interface IListener {
|
|
7
|
+
void onUserIdReceived(String userId);
|
|
8
|
+
void onSessionIdReceived(String sessionId);
|
|
9
|
+
void onSequenceReceived(int sequence);
|
|
10
|
+
void onErrorCodeReceived(in ErrorCode errorCode);
|
|
11
|
+
void onStopTrackingReceived(String sessionId);
|
|
12
|
+
}
|