@amazon-devices/expo-application 2.0.1758683737 → 2.0.9000000001

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/CMakeLists.txt CHANGED
@@ -17,10 +17,18 @@ set(SOURCES_KEPLER kepler/ExpoApplication.cpp)
17
17
 
18
18
  add_library(${PACKAGE_NAME} STATIC ${SOURCES_KEPLER})
19
19
 
20
+ kepler_add_idl_import_library(
21
+ idl_pkg
22
+ PACKAGES
23
+ com.amazon.kepler.experimental_mr33.packages
24
+ com.amazon.kepler.security
25
+ )
26
+
20
27
  target_link_libraries(
21
28
  ${PACKAGE_NAME}
22
29
  PUBLIC
23
- keplerui::keplerscript-${KEPLER_REACT_NATIVE_MAJOR_VERSION}
30
+ turbomoduleAPI::turbomoduleAPI
31
+ idl_pkg
24
32
  )
25
33
 
26
34
  add_library(${AUTO_LINK_PACKAGE_NAME} SHARED kepler/KeplerInit.cpp)
@@ -38,7 +46,8 @@ add_executable(${AUTO_LINK_PACKAGE_NAME}_exe kepler/KeplerInit.cpp)
38
46
  target_link_libraries(${AUTO_LINK_PACKAGE_NAME}_exe
39
47
  PRIVATE
40
48
  ${AUTO_LINK_PACKAGE_NAME}
41
- keplerui::keplerscript-${KEPLER_REACT_NATIVE_MAJOR_VERSION}
49
+ turbomoduleAPI::turbomoduleAPI
50
+ idl_pkg
42
51
  )
43
52
 
44
53
  install(TARGETS ${AUTO_LINK_PACKAGE_NAME}
package/README.kepler.md CHANGED
@@ -101,3 +101,4 @@ Check out the dedicated documentation page for info about this library, API refe
101
101
  | Package version | Based on | @amazon-devices/react-native-kepler version |
102
102
  | ---------------- | -------- | --------------------------------- |
103
103
  | 2.0.x | expo-application v5.6.0 | 2.0.x |
104
+ | 2.0.x | expo-application v5.6.0 | 4.0.x+rn0.83.0 |
@@ -1,24 +1,4 @@
1
1
  License from package.json:
2
2
  ==============================
3
3
 
4
- The MIT License (MIT)
5
-
6
- Copyright (c) 2015-present 650 Industries, Inc. (aka Expo)
7
-
8
- Permission is hereby granted, free of charge, to any person obtaining a copy
9
- of this software and associated documentation files (the "Software"), to deal
10
- in the Software without restriction, including without limitation the rights
11
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- copies of the Software, and to permit persons to whom the Software is
13
- furnished to do so, subject to the following conditions:
14
-
15
- The above copyright notice and this permission notice shall be included in all
16
- copies or substantial portions of the Software.
17
-
18
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
- SOFTWARE.
4
+ MIT
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoApplication.kepler.d.ts","sourceRoot":"","sources":["../src/ExpoApplication.kepler.ts"],"names":[],"mappings":"AAaA,UAAU,qBAAqB;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,wBAAwB,EAAE,MAAM,CAAC;IACjC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,wBAAwB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAChD,sBAAsB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;CACjD;AAED,QAAA,MAAM,MAAM,EAAE,qBAqBb,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"ExpoApplication.kepler.d.ts","sourceRoot":"","sources":["../src/ExpoApplication.kepler.ts"],"names":[],"mappings":"AAcA,UAAU,qBAAqB;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,wBAAwB,EAAE,MAAM,CAAC;IACjC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,wBAAwB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAChD,sBAAsB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/C;AAED,QAAA,MAAM,MAAM,EAAE,qBAmBb,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -14,12 +14,10 @@ const module = {
14
14
  return nativeModule.nativeBuildVersion();
15
15
  },
16
16
  async getInstallationTimeAsync() {
17
- const installationTime = await nativeModule.getInstallationTimeAsync();
18
- return Number.parseInt(installationTime) * 1000;
17
+ return nativeModule.getInstallationTimeAsync();
19
18
  },
20
19
  async getLastUpdateTimeAsync() {
21
- const lastUpdateTime = await nativeModule.getLastUpdateTimeAsync();
22
- return Number.parseInt(lastUpdateTime) * 1000;
20
+ return nativeModule.getLastUpdateTimeAsync();
23
21
  },
24
22
  };
25
23
  export default module;
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoApplication.kepler.js","sourceRoot":"","sources":["../src/ExpoApplication.kepler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,mBAAmB,EAAC,MAAM,oCAAoC,CAAC;AAW1F,MAAM,YAAY,GAAG,mBAAmB,CAAC,YAAY,CAAO,iBAAiB,CAAS,CAAC;AAWvF,MAAM,MAAM,GAA0B;IAClC,IAAI,aAAa;QACb,OAAO,YAAY,CAAC,aAAa,EAAE,CAAC;IACxC,CAAC;IACD,IAAI,eAAe;QACf,OAAO,YAAY,CAAC,eAAe,EAAE,CAAC;IAC1C,CAAC;IACD,IAAI,wBAAwB;QACxB,OAAO,YAAY,CAAC,wBAAwB,EAAE,CAAC;IACnD,CAAC;IACD,IAAI,kBAAkB;QAClB,OAAO,YAAY,CAAC,kBAAkB,EAAE,CAAC;IAC7C,CAAC;IACD,KAAK,CAAC,wBAAwB;QAC1B,MAAM,gBAAgB,GAAG,MAAM,YAAY,CAAC,wBAAwB,EAAE,CAAC;QACvE,OAAO,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;IACpD,CAAC;IACD,KAAK,CAAC,sBAAsB;QACxB,MAAM,cAAc,GAAG,MAAM,YAAY,CAAC,sBAAsB,EAAE,CAAC;QACnE,OAAO,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;IAClD,CAAC;CACJ,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import {KeplerTurboModule, TurboModuleRegistry} from '@amazon-devices/keplerscript-turbomodule-api';\n\ninterface Spec extends KeplerTurboModule {\n applicationId: () => string;\n applicationName: () => string;\n nativeApplicationVersion: () => string;\n nativeBuildVersion: () => string;\n getInstallationTimeAsync: () => Promise<string>;\n getLastUpdateTimeAsync: () => Promise<string>;\n}\n\nconst nativeModule = TurboModuleRegistry.getEnforcing<Spec>('ExpoApplication') as Spec;\n\ninterface KeplerExpoApplication {\n applicationId: string;\n applicationName: string;\n nativeApplicationVersion: string;\n nativeBuildVersion: string;\n getInstallationTimeAsync: () => Promise<number>;\n getLastUpdateTimeAsync: () => Promise<number>;\n}\n\nconst module: KeplerExpoApplication = {\n get applicationId() {\n return nativeModule.applicationId();\n },\n get applicationName() {\n return nativeModule.applicationName();\n },\n get nativeApplicationVersion() {\n return nativeModule.nativeApplicationVersion();\n },\n get nativeBuildVersion() {\n return nativeModule.nativeBuildVersion();\n },\n async getInstallationTimeAsync(): Promise<number> {\n const installationTime = await nativeModule.getInstallationTimeAsync();\n return Number.parseInt(installationTime) * 1000;\n },\n async getLastUpdateTimeAsync(): Promise<number> {\n const lastUpdateTime = await nativeModule.getLastUpdateTimeAsync();\n return Number.parseInt(lastUpdateTime) * 1000;\n },\n};\n\nexport default module;\n"]}
1
+ {"version":3,"file":"ExpoApplication.kepler.js","sourceRoot":"","sources":["../src/ExpoApplication.kepler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAWzE,MAAM,YAAY,GAAG,mBAAmB,CAAC,YAAY,CAAO,iBAAiB,CAAS,CAAC;AAWvF,MAAM,MAAM,GAA0B;IACpC,IAAI,aAAa;QACf,OAAO,YAAY,CAAC,aAAa,EAAE,CAAC;IACtC,CAAC;IACD,IAAI,eAAe;QACjB,OAAO,YAAY,CAAC,eAAe,EAAE,CAAC;IACxC,CAAC;IACD,IAAI,wBAAwB;QAC1B,OAAO,YAAY,CAAC,wBAAwB,EAAE,CAAC;IACjD,CAAC;IACD,IAAI,kBAAkB;QACpB,OAAO,YAAY,CAAC,kBAAkB,EAAE,CAAC;IAC3C,CAAC;IACD,KAAK,CAAC,wBAAwB;QAC5B,OAAO,YAAY,CAAC,wBAAwB,EAAE,CAAC;IACjD,CAAC;IACD,KAAK,CAAC,sBAAsB;QAC1B,OAAO,YAAY,CAAC,sBAAsB,EAAE,CAAC;IAC/C,CAAC;CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import type { KeplerTurboModule } from '@amazon-devices/keplerscript-turbomodule-api';\nimport { TurboModuleRegistry } from '@amazon-devices/keplerscript-turbomodule-api';\n\ninterface Spec extends KeplerTurboModule {\n applicationId: () => string;\n applicationName: () => string;\n nativeApplicationVersion: () => string;\n nativeBuildVersion: () => string;\n getInstallationTimeAsync: () => Promise<number>;\n getLastUpdateTimeAsync: () => Promise<number>;\n}\n\nconst nativeModule = TurboModuleRegistry.getEnforcing<Spec>('ExpoApplication') as Spec;\n\ninterface KeplerExpoApplication {\n applicationId: string;\n applicationName: string;\n nativeApplicationVersion: string;\n nativeBuildVersion: string;\n getInstallationTimeAsync: () => Promise<number>;\n getLastUpdateTimeAsync: () => Promise<number>;\n}\n\nconst module: KeplerExpoApplication = {\n get applicationId() {\n return nativeModule.applicationId();\n },\n get applicationName() {\n return nativeModule.applicationName();\n },\n get nativeApplicationVersion() {\n return nativeModule.nativeApplicationVersion();\n },\n get nativeBuildVersion() {\n return nativeModule.nativeBuildVersion();\n },\n async getInstallationTimeAsync(): Promise<number> {\n return nativeModule.getInstallationTimeAsync();\n },\n async getLastUpdateTimeAsync(): Promise<number> {\n return nativeModule.getLastUpdateTimeAsync();\n },\n};\n\nexport default module;\n"]}
@@ -8,57 +8,88 @@
8
8
 
9
9
  #include "ExpoApplication.h"
10
10
 
11
- #include <KeplerScript/logger/KPLog.h>
11
+ #include <Kepler/turbomodule/TMLog.h>
12
+ #include <apmf/iface/com/amazon/apmf/ICredential.h>
13
+ #include <apmf/iface/com/amazon/apmf/RealTimeInstant.h>
14
+ #include <apmf/iface/com/amazon/kepler/experimental_mr33/packages/IKeplerPackageManagerModule.h>
15
+ #include <apmf/iface/com/amazon/kepler/experimental_mr33/packages/ILocaleString.h>
16
+ #include <apmf/iface/com/amazon/kepler/experimental_mr33/packages/IPackageRegistry3.h>
17
+ #include <apmf/iface/com/amazon/kepler/security/IKeplerSecurityModule.h>
18
+ #include <apmf/process.h>
19
+ #include <apmf/string.h>
20
+ #include <fmt/format.h>
12
21
 
13
- using namespace orpheus::framework;
22
+ #include <stdexcept>
14
23
 
15
- status::Status KeplerPackageManager::getSelfPackageInfo(packageManager::PackageInfo& packageInfo) const {
16
- return packageManager::PackageManager::getInstance().getSelfPackageInfo(packageInfo);
17
- }
24
+ using apmf::ICredential;
25
+ using apmf::iface::com::amazon::kepler::experimental_mr33::packages::IKeplerPackageManagerModule;
26
+ using apmf::iface::com::amazon::kepler::experimental_mr33::packages::IPackage;
27
+ using apmf::iface::com::amazon::kepler::experimental_mr33::packages::IPackageRegistry3;
28
+ using apmf::iface::com::amazon::kepler::security::IKeplerSecurityModule;
29
+ using com::amazon::kepler::turbomodule::Promise;
18
30
 
19
- ExpoApplication::ExpoApplication(const IPackageManager& packageManager) : volta::react::KeplerTurboModule("ExpoApplication") {
20
- volta::react::KPLog.debug("ExpoApplication constructor {}", name());
31
+ ExpoApplication::ExpoApplication() : com::amazon::kepler::turbomodule::KeplerTurboModule("ExpoApplication") {
32
+ TMDEBUG(fmt::format("ExpoApplication constructor {}", name()));
21
33
 
22
- auto status = packageManager.getSelfPackageInfo(this->packageInfo);
23
- if (!status.isOk()) {
24
- throw "ExpoApplication failed to get package info with status: " + std::string{status.toString()};
34
+ try {
35
+ apmf::Ptr<IKeplerPackageManagerModule> packageManagerModule =
36
+ apmf::GetProcessObject()
37
+ ->getComponent("/com.amazon.kepler.experimental_mr33.packages")
38
+ .QueryInterface<IKeplerPackageManagerModule>();
39
+ apmf::Ptr<IKeplerSecurityModule> securityInterface = apmf::GetProcessObject()
40
+ ->getComponent("/com.amazon.kepler.security")
41
+ .QueryInterface<IKeplerSecurityModule>();
42
+ apmf::Ptr<ICredential> credentials = securityInterface->getCurrentContextCredential();
43
+ apmf::Ptr<IPackageRegistry3> iPackageRegistry3 =
44
+ packageManagerModule->makePackageRegistry().TryQueryInterface<IPackageRegistry3>();
45
+ packageInfo = iPackageRegistry3->tryGetPackageByCredential(credentials);
46
+ } catch (const std::exception& e) {
47
+ TMERROR(fmt::format("Exception caught: {}", e.what()));
48
+ throw std::runtime_error(e.what());
49
+ } catch (...) {
50
+ TMERROR("Unknown error caught");
51
+ throw std::runtime_error("Unknown error caught in ExpoApplication constructor");
25
52
  }
26
53
  }
27
54
 
28
55
  std::string ExpoApplication::applicationId() {
29
- return packageInfo.id;
56
+ return packageInfo->getId();
30
57
  }
31
58
 
32
59
  std::string ExpoApplication::applicationName() {
33
- return packageInfo.title;
60
+ auto title = packageInfo->getTitle();
61
+ if (title != nullptr) {
62
+ return title->getValue();
63
+ }
64
+ return {};
34
65
  }
35
66
 
36
67
  std::string ExpoApplication::nativeApplicationVersion() {
37
- return packageInfo.version;
68
+ return packageInfo->getVersion();
38
69
  }
39
70
 
40
71
  std::string ExpoApplication::nativeBuildVersion() {
41
- return packageInfo.version;
72
+ return packageInfo->getVersion();
42
73
  }
43
74
 
44
- volta::react::Promise ExpoApplication::getInstallationTimeAsync() {
45
- return volta::react::Promise([this](std::shared_ptr<volta::react::Promise> promise) {
75
+ Promise ExpoApplication::getInstallationTimeAsync() {
76
+ return Promise([this](std::shared_ptr<Promise> promise) {
77
+ auto installationTime = packageInfo->getInstalledTime();
46
78
  try {
47
- // Returning this as a string due to the lack of support for time_t in callbacks
48
- auto installationTimeStr = std::to_string(packageInfo.installTime);
49
- promise->resolve(installationTimeStr);
79
+ std::int64_t milliseconds = installationTime.time.seconds * 1000;
80
+ promise->resolve(milliseconds);
50
81
  } catch (std::exception& e) {
51
82
  promise->reject(std::string{"getInstallationTimeAsync() error: " + std::string(e.what())});
52
83
  }
53
84
  });
54
85
  }
55
86
 
56
- volta::react::Promise ExpoApplication::getLastUpdateTimeAsync() {
57
- return volta::react::Promise([this](std::shared_ptr<volta::react::Promise> promise) {
87
+ Promise ExpoApplication::getLastUpdateTimeAsync() {
88
+ return Promise([this](std::shared_ptr<Promise> promise) {
89
+ auto lastUpdateTime = packageInfo->getUpdatedTime();
58
90
  try {
59
- // Returning this as a string due to the lack of support for time_t in callbacks
60
- auto lastUpdateTimeStr = std::to_string(packageInfo.updateTime);
61
- promise->resolve(lastUpdateTimeStr);
91
+ std::int64_t milliseconds = lastUpdateTime.time.seconds * 1000;
92
+ promise->resolve(milliseconds);
62
93
  } catch (std::exception& e) {
63
94
  promise->reject(std::string{"getLastUpdateTimeAsync() error: " + std::string(e.what())});
64
95
  }
@@ -66,8 +97,9 @@ volta::react::Promise ExpoApplication::getLastUpdateTimeAsync() {
66
97
  }
67
98
 
68
99
  void ExpoApplication::aggregateMethods(
69
- volta::react::MethodAggregator<volta::react::KeplerTurboModule>& methodAggregator) const noexcept {
70
- volta::react::KPLog.debug("methodAggregator");
100
+ com::amazon::kepler::turbomodule::MethodAggregator<com::amazon::kepler::turbomodule::KeplerTurboModule>&
101
+ methodAggregator) const noexcept {
102
+ TMDEBUG("methodAggregator");
71
103
 
72
104
  methodAggregator.addMethod("applicationId", 0, &ExpoApplication::applicationId);
73
105
  methodAggregator.addMethod("applicationName", 0, &ExpoApplication::applicationName);
@@ -6,23 +6,19 @@
6
6
  * Use is subject to license terms.
7
7
  */
8
8
 
9
- #include <KeplerScript/modules/KeplerTurboModule.h>
10
- #include <orpheus/framework/package-manager/PackageManager.h>
9
+ #include <Kepler/turbomodule/KeplerTurboModule.h>
10
+ #include "expo-export.h"
11
11
 
12
- class IPackageManager {
13
- public:
14
- virtual ~IPackageManager() = default;
15
- virtual orpheus::framework::status::Status getSelfPackageInfo(orpheus::framework::packageManager::PackageInfo& packageInfo) const = 0;
16
- };
12
+ #include <apmf/iface/com/amazon/kepler/experimental_mr33/packages/IPackage.h>
13
+ #include <apmf/ptr.h>
17
14
 
18
- class KEPLERSCRIPT_EXPORT KeplerPackageManager : public IPackageManager {
15
+ class EXPO_EXPORT ExpoApplication : public com::amazon::kepler::turbomodule::KeplerTurboModule {
19
16
  public:
20
- orpheus::framework::status::Status getSelfPackageInfo(orpheus::framework::packageManager::PackageInfo& packageInfo) const override;
21
- };
17
+ ExpoApplication();
22
18
 
23
- class KEPLERSCRIPT_EXPORT ExpoApplication : public volta::react::KeplerTurboModule {
24
- public:
25
- ExpoApplication(const IPackageManager& pm = KeplerPackageManager());
19
+ void aggregateMethods(
20
+ com::amazon::kepler::turbomodule::MethodAggregator<com::amazon::kepler::turbomodule::KeplerTurboModule>&
21
+ methodAggregator) const noexcept override;
26
22
 
27
23
  #ifndef UNIT_TEST
28
24
  protected:
@@ -31,14 +27,11 @@ protected:
31
27
  std::string applicationName();
32
28
  std::string nativeApplicationVersion();
33
29
  std::string nativeBuildVersion();
34
- volta::react::Promise getInstallationTimeAsync();
35
- volta::react::Promise getLastUpdateTimeAsync();
36
-
37
- void aggregateMethods(
38
- volta::react::MethodAggregator<volta::react::KeplerTurboModule>& methodAggregator) const noexcept override;
30
+ com::amazon::kepler::turbomodule::Promise getInstallationTimeAsync();
31
+ com::amazon::kepler::turbomodule::Promise getLastUpdateTimeAsync();
39
32
 
40
33
  #ifndef UNIT_TEST
41
34
  private:
42
35
  #endif
43
- orpheus::framework::packageManager::PackageInfo packageInfo;
36
+ apmf::Ptr<apmf::iface::com::amazon::kepler::experimental_mr33::packages::IPackage> packageInfo;
44
37
  };
@@ -6,23 +6,18 @@
6
6
  * Use is subject to license terms.
7
7
  */
8
8
 
9
- #include <KeplerScript/logger/KPLog.h>
10
- #include <KeplerScript/utils/autolink/KeplerAutoLinkInfo.h>
11
- #include <keplerui-072/keplerscript-export.h>
9
+ #include <Kepler/turbomodule/KeplerTurboModuleRegistration.h>
10
+ #include <Kepler/turbomodule/TMLog.h>
12
11
 
13
12
  #include "ExpoApplication.h"
14
- #include "RegisterModule.h"
15
13
 
16
14
  extern "C" {
17
- KEPLERSCRIPT_EXPORT void keplerAutoLinkInitV1(const kepler::autolink::v1::KeplerAutoLinkInfo* autoLinkInfo) noexcept {
18
- volta::react::KPLog.debug("keplerAutoLinkInitV1 for ExpoApplication");
19
-
20
- REGISTER_MODULE(autoLinkInfo, ExpoApplication, "ExpoApplication");
21
-
22
- volta::react::KPLog.debug("after registering module");
15
+ __attribute__((visibility("default"))) void autoLinkKeplerTurboModulesV1() noexcept {
16
+ TMDEBUG("autoLinkKeplerTurboModulesV1 for expo-application");
17
+ KEPLER_REGISTER_TURBO_MODULE_WITH_NAME("ExpoApplication", ExpoApplication);
23
18
  }
24
19
  }
25
20
 
26
21
  int main() {
27
22
  return 0;
28
- }
23
+ }
@@ -15,20 +15,6 @@
15
15
 
16
16
  #include "../ExpoApplication.h"
17
17
 
18
- using namespace volta::react;
19
-
20
- class MockPackageManager : public IPackageManager {
21
- public:
22
- orpheus::framework::status::Status getSelfPackageInfo(orpheus::framework::packageManager::PackageInfo &packageInfo) const override {
23
- packageInfo.id = "testID";
24
- packageInfo.title = "testTitle";
25
- packageInfo.version = "testVersion";
26
- packageInfo.installTime = static_cast<std::time_t>(999);
27
- packageInfo.updateTime = static_cast<std::time_t>(111);
28
- return orpheus::framework::status::Status{};
29
- }
30
- };
31
-
32
18
  // std::shared_ptr<Promise> getPromiseCallback(std::string& result) {
33
19
  // return std::make_shared<Promise>(
34
20
  // Callback([&result](auto v) {
@@ -0,0 +1,7 @@
1
+ {
2
+ "versions": {
3
+ "2.0.0": "/com.amazon.kepler.expo_application_2@IExpoApplication_0",
4
+ "2.0.9000000000": "/com.amazon.kepler.expo_application_2@IExpoApplication_0",
5
+ "2.0.9000000001": "/com.amazon.kepler.expo_application_2@IExpoApplication_0"
6
+ }
7
+ }
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "@amazon-devices/expo-application", "version": "2.0.1758683737+5.6.0", "description": "A universal module that gets native application information such as its ID, app name, and build version at runtime", "main": "build/Application.js", "types": "build/Application.d.ts", "scripts": {"build": "expo-module build", "clean": "expo-module clean", "lint": "expo-module lint", "test": "expo-module test", "expo-module": "expo-module"}, "kepler": {"temporary-alias-for-package": {"name": "expo-application", "version": "5.6.0"}}, "keywords": ["react-native", "expo", "expo-application"], "repository": {"type": "git", "url": "https://github.com/expo/expo.git", "directory": "packages/expo-application"}, "bugs": {"url": "https://github.com/expo/expo/issues"}, "author": "650 Industries, Inc.", "license": "See license in LICENSE", "homepage": "https://docs.expo.dev/versions/latest/sdk/application/", "jest": {"preset": "expo-module-scripts"}, "dependencies": {"@amazon-devices/keplerscript-turbomodule-api": "^1.0.0"}, "devDependencies": {"expo-module-scripts": "^3.0.0"}, "peerDependencies": {"expo": "*"}}
1
+ {"name": "@amazon-devices/expo-application", "version": "2.0.9000000001+5.6.0", "description": "A universal module that gets native application information such as its ID, app name, and build version at runtime", "main": "build/Application.js", "types": "build/Application.d.ts", "scripts": {"build": "expo-module build", "clean": "expo-module clean", "lint": "expo-module lint", "test": "expo-module test", "prepublishOnly": "expo-module prepublishOnly", "expo-module": "expo-module"}, "kepler": {"temporary-alias-for-package": {"name": "expo-application", "version": "5.6.0"}}, "keywords": ["react-native", "expo", "expo-application"], "repository": {"type": "git", "url": "https://github.com/expo/expo.git", "directory": "packages/expo-application"}, "bugs": {"url": "https://github.com/expo/expo/issues"}, "author": "650 Industries, Inc.", "license": "See license in LICENSE", "homepage": "https://docs.expo.dev/versions/latest/sdk/application/", "jest": {"preset": "expo-module-scripts"}, "dependencies": {"@amazon-devices/keplerscript-turbomodule-api": "^1.0.0"}, "devDependencies": {"expo-module-scripts": "^3.0.0"}, "peerDependencies": {"expo": "^50.0.0-alpha.1"}}
@@ -12,6 +12,7 @@ module.exports = {
12
12
  autolink: {
13
13
  ExpoApplicationLib: {
14
14
  provider: 'system',
15
+ libraryName: 'libexpo-application-2.so.2',
15
16
  turbomodules: ['ExpoApplication'],
16
17
  },
17
18
  },
@@ -1,46 +1,45 @@
1
- import {KeplerTurboModule, TurboModuleRegistry} from '@amazon-devices/keplerscript-turbomodule-api';
1
+ import type { KeplerTurboModule } from '@amazon-devices/keplerscript-turbomodule-api';
2
+ import { TurboModuleRegistry } from '@amazon-devices/keplerscript-turbomodule-api';
2
3
 
3
4
  interface Spec extends KeplerTurboModule {
4
- applicationId: () => string;
5
- applicationName: () => string;
6
- nativeApplicationVersion: () => string;
7
- nativeBuildVersion: () => string;
8
- getInstallationTimeAsync: () => Promise<string>;
9
- getLastUpdateTimeAsync: () => Promise<string>;
5
+ applicationId: () => string;
6
+ applicationName: () => string;
7
+ nativeApplicationVersion: () => string;
8
+ nativeBuildVersion: () => string;
9
+ getInstallationTimeAsync: () => Promise<number>;
10
+ getLastUpdateTimeAsync: () => Promise<number>;
10
11
  }
11
12
 
12
13
  const nativeModule = TurboModuleRegistry.getEnforcing<Spec>('ExpoApplication') as Spec;
13
14
 
14
15
  interface KeplerExpoApplication {
15
- applicationId: string;
16
- applicationName: string;
17
- nativeApplicationVersion: string;
18
- nativeBuildVersion: string;
19
- getInstallationTimeAsync: () => Promise<number>;
20
- getLastUpdateTimeAsync: () => Promise<number>;
16
+ applicationId: string;
17
+ applicationName: string;
18
+ nativeApplicationVersion: string;
19
+ nativeBuildVersion: string;
20
+ getInstallationTimeAsync: () => Promise<number>;
21
+ getLastUpdateTimeAsync: () => Promise<number>;
21
22
  }
22
23
 
23
24
  const module: KeplerExpoApplication = {
24
- get applicationId() {
25
- return nativeModule.applicationId();
26
- },
27
- get applicationName() {
28
- return nativeModule.applicationName();
29
- },
30
- get nativeApplicationVersion() {
31
- return nativeModule.nativeApplicationVersion();
32
- },
33
- get nativeBuildVersion() {
34
- return nativeModule.nativeBuildVersion();
35
- },
36
- async getInstallationTimeAsync(): Promise<number> {
37
- const installationTime = await nativeModule.getInstallationTimeAsync();
38
- return Number.parseInt(installationTime) * 1000;
39
- },
40
- async getLastUpdateTimeAsync(): Promise<number> {
41
- const lastUpdateTime = await nativeModule.getLastUpdateTimeAsync();
42
- return Number.parseInt(lastUpdateTime) * 1000;
43
- },
25
+ get applicationId() {
26
+ return nativeModule.applicationId();
27
+ },
28
+ get applicationName() {
29
+ return nativeModule.applicationName();
30
+ },
31
+ get nativeApplicationVersion() {
32
+ return nativeModule.nativeApplicationVersion();
33
+ },
34
+ get nativeBuildVersion() {
35
+ return nativeModule.nativeBuildVersion();
36
+ },
37
+ async getInstallationTimeAsync(): Promise<number> {
38
+ return nativeModule.getInstallationTimeAsync();
39
+ },
40
+ async getLastUpdateTimeAsync(): Promise<number> {
41
+ return nativeModule.getLastUpdateTimeAsync();
42
+ },
44
43
  };
45
44
 
46
45
  export default module;