@iternio/react-native-auto-play 0.6.1 → 0.7.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/README.md +3 -3
- package/android/src/automotive/AndroidManifest-nonnav.xml +0 -2
- package/android/src/automotive/AndroidManifest.xml +0 -2
- package/android/src/main/AndroidManifest-nonnav.xml +0 -2
- package/android/src/main/AndroidManifest.xml +0 -2
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/AndroidAutoService.kt +3 -27
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlayTiming.kt +122 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/Parser.kt +2 -2
- package/installTimers.ts +3 -0
- package/installTimers.web.ts +2 -0
- package/ios/hybrid/HybridAutoPlayTiming.swift +123 -0
- package/lib/components/SafeAreaView.js +1 -1
- package/lib/hybrid/HybridAutoPlayTiming.d.ts +2 -0
- package/lib/hybrid/HybridAutoPlayTiming.js +2 -0
- package/lib/hybrid/HybridVoice.js +2 -2
- package/lib/index.js +0 -2
- package/lib/index.web.d.ts +4 -2
- package/lib/installTimers.d.ts +1 -0
- package/lib/installTimers.js +8 -0
- package/lib/installTimers.web.d.ts +1 -0
- package/lib/installTimers.web.js +2 -0
- package/lib/scenes/CarPlayDashboardScene.d.ts +3 -3
- package/lib/specs/AutoPlayTiming.nitro.d.ts +27 -0
- package/lib/specs/AutoPlayTiming.nitro.js +1 -0
- package/lib/types/Telemetry.d.ts +1 -1
- package/lib/utils/AutoPlayTimers.d.ts +21 -0
- package/lib/utils/AutoPlayTimers.js +45 -0
- package/lib/utils/NitroImage.d.ts +5 -2
- package/lib/utils/NitroImage.js +1 -1
- package/lib-cjs/components/SafeAreaView.js +1 -1
- package/lib-cjs/hybrid/HybridVoice.js +2 -2
- package/lib-cjs/index.js +0 -5
- package/lib-cjs/utils/NitroImage.js +1 -1
- package/nitro.json +10 -0
- package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +2 -0
- package/nitrogen/generated/android/ReactNativeAutoPlayOnLoad.cpp +16 -0
- package/nitrogen/generated/android/c++/JActiveCarUxRestrictions.hpp +1 -1
- package/nitrogen/generated/android/c++/JAlertActionStyle.hpp +1 -1
- package/nitrogen/generated/android/c++/JAlertDismissalReason.hpp +1 -1
- package/nitrogen/generated/android/c++/JAppFocusState.hpp +1 -1
- package/nitrogen/generated/android/c++/JAssetImage.hpp +18 -18
- package/nitrogen/generated/android/c++/JAutoText.hpp +1 -1
- package/nitrogen/generated/android/c++/JBooleanTelemetryItem.hpp +1 -1
- package/nitrogen/generated/android/c++/JCarUxRestrictions.hpp +1 -1
- package/nitrogen/generated/android/c++/JChargingConnector.hpp +1 -1
- package/nitrogen/generated/android/c++/JClusterEventName.hpp +1 -1
- package/nitrogen/generated/android/c++/JColorScheme.hpp +1 -1
- package/nitrogen/generated/android/c++/JDistance.hpp +1 -1
- package/nitrogen/generated/android/c++/JDistanceUnits.hpp +1 -1
- package/nitrogen/generated/android/c++/JDurationWithTimeZone.hpp +1 -1
- package/nitrogen/generated/android/c++/JEventName.hpp +1 -1
- package/nitrogen/generated/android/c++/JForkType.hpp +1 -1
- package/nitrogen/generated/android/c++/JGlyphImage.hpp +1 -1
- package/nitrogen/generated/android/c++/JGoogleSignIn.hpp +1 -1
- package/nitrogen/generated/android/c++/JGoogleSignInAccount.hpp +1 -1
- package/nitrogen/generated/android/c++/JGridImageSize.hpp +1 -1
- package/nitrogen/generated/android/c++/JGridTemplateConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JHybridAutoPlayTimingSpec.cpp +59 -0
- package/nitrogen/generated/android/c++/JHybridAutoPlayTimingSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JImageLane.hpp +1 -1
- package/nitrogen/generated/android/c++/JInformationTemplateConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JInputSignIn.hpp +1 -1
- package/nitrogen/generated/android/c++/JKeepType.hpp +1 -1
- package/nitrogen/generated/android/c++/JKeyboardType.hpp +1 -1
- package/nitrogen/generated/android/c++/JLaneGuidance.hpp +1 -1
- package/nitrogen/generated/android/c++/JListImageType.hpp +1 -1
- package/nitrogen/generated/android/c++/JListTemplateConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JLocation.hpp +1 -1
- package/nitrogen/generated/android/c++/JManeuverState.hpp +1 -1
- package/nitrogen/generated/android/c++/JManeuverType.hpp +1 -1
- package/nitrogen/generated/android/c++/JMapTemplateConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JMessageTemplateConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JNavigationAlertAction.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroAction.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroActionType.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroAlignment.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroAttributedString.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroAttributedStringImage.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroBaseMapTemplateConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroButtonStyle.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroChargerLocation.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroChargerOutlet.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroColor.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroGridButton.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroLoadingManeuver.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroMapButton.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroMapButtonType.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroMessageManeuver.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroNavigationAlert.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroOptionsPanelChargerSection.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroOptionsPanelConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroOptionsPanelGridSection.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroRoutingManeuver.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroRow.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroSection.hpp +1 -1
- package/nitrogen/generated/android/c++/JNitroSectionType.hpp +1 -1
- package/nitrogen/generated/android/c++/JNumericTelemetryItem.hpp +1 -1
- package/nitrogen/generated/android/c++/JOffRampType.hpp +1 -1
- package/nitrogen/generated/android/c++/JOnRampType.hpp +1 -1
- package/nitrogen/generated/android/c++/JPermissionRequestResult.hpp +1 -1
- package/nitrogen/generated/android/c++/JPinSignIn.hpp +1 -1
- package/nitrogen/generated/android/c++/JPoint.hpp +1 -1
- package/nitrogen/generated/android/c++/JPreferredImageLane.hpp +1 -1
- package/nitrogen/generated/android/c++/JQrSignIn.hpp +1 -1
- package/nitrogen/generated/android/c++/JRemoteImage.hpp +1 -1
- package/nitrogen/generated/android/c++/JRouteChoice.hpp +1 -1
- package/nitrogen/generated/android/c++/JSafeAreaInsets.hpp +1 -1
- package/nitrogen/generated/android/c++/JSearchTemplateConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JSignInMethods.hpp +1 -1
- package/nitrogen/generated/android/c++/JSignInTemplateConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JStringTelemetryItem.hpp +1 -1
- package/nitrogen/generated/android/c++/JTelemetry.hpp +1 -1
- package/nitrogen/generated/android/c++/JTextInputType.hpp +1 -1
- package/nitrogen/generated/android/c++/JTrafficSide.hpp +1 -1
- package/nitrogen/generated/android/c++/JTravelEstimates.hpp +1 -1
- package/nitrogen/generated/android/c++/JTripConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JTripPoint.hpp +1 -1
- package/nitrogen/generated/android/c++/JTripPreviewTextConfiguration.hpp +1 -1
- package/nitrogen/generated/android/c++/JTripSelectorCallback.hpp +1 -1
- package/nitrogen/generated/android/c++/JTripsConfig.hpp +1 -1
- package/nitrogen/generated/android/c++/JTurnType.hpp +1 -1
- package/nitrogen/generated/android/c++/JVehicleTelemetryItem.hpp +1 -1
- package/nitrogen/generated/android/c++/JVisibilityState.hpp +1 -1
- package/nitrogen/generated/android/c++/JVisibleTravelEstimate.hpp +1 -1
- package/nitrogen/generated/android/c++/JVoiceAudioEncoding.hpp +1 -1
- package/nitrogen/generated/android/c++/JVoiceInputChunk.hpp +1 -1
- package/nitrogen/generated/android/c++/JVoiceInputResult.hpp +1 -1
- package/nitrogen/generated/android/c++/JWaypointCoordinate.hpp +1 -1
- package/nitrogen/generated/android/c++/JWindowInformation.hpp +1 -1
- package/nitrogen/generated/android/c++/JZoomEvent.hpp +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/AssetImage.kt +15 -15
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_ActiveCarUxRestrictions.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_AlertDismissalReason.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_AppFocusState.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_ColorScheme.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_Point.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_Point_double.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_Point_std__optional_Point_.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_SafeAreaInsets.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_VisibilityState.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_VoiceInputChunk.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_WindowInformation.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_bool.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__optional_Location__std__optional_std__string_.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__optional_Telemetry_.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__optional_bool_.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__optional_std__string__std__optional_GoogleSignInAccount_.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__string.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__string_ColorScheme.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__string_ZoomEvent.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__string_bool.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__string_std__string.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidAutoTelemetrySpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidAutomotiveSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidWindowInformationSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlaySpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlayTimingSpec.kt +65 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridClusterSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridGridTemplateSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridInformationTemplateSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridListTemplateSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridMapTemplateSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridMessageTemplateSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridSearchTemplateSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridSignInTemplateSpec.kt +2 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridVoiceSpec.kt +2 -0
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.cpp +17 -0
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.hpp +35 -9
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Umbrella.hpp +5 -0
- package/nitrogen/generated/ios/ReactNativeAutoPlayAutolinking.mm +8 -0
- package/nitrogen/generated/ios/ReactNativeAutoPlayAutolinking.swift +12 -0
- package/nitrogen/generated/ios/c++/HybridAutoPlayTimingSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridAutoPlayTimingSpecSwift.hpp +88 -0
- package/nitrogen/generated/ios/swift/AssetImage.swift +13 -13
- package/nitrogen/generated/ios/swift/HybridAutoPlayTimingSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridAutoPlayTimingSpec_cxx.swift +154 -0
- package/nitrogen/generated/shared/c++/AssetImage.hpp +18 -18
- package/nitrogen/generated/shared/c++/HybridAutoPlayTimingSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridAutoPlayTimingSpec.hpp +63 -0
- package/package.json +6 -4
- package/src/components/SafeAreaView.tsx +1 -1
- package/src/hybrid/HybridAutoPlayTiming.ts +5 -0
- package/src/hybrid/HybridVoice.ts +2 -2
- package/src/index.ts +0 -3
- package/src/installTimers.ts +9 -0
- package/src/installTimers.web.ts +2 -0
- package/src/specs/AutoPlayTiming.nitro.ts +25 -0
- package/src/types/Telemetry.ts +1 -1
- package/src/utils/AutoPlayTimers.ts +60 -0
- package/src/utils/NitroImage.ts +13 -3
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HeadlessTaskService.kt +0 -36
- package/lib/AutoPlayHeadlessJsTask.d.ts +0 -5
- package/lib/AutoPlayHeadlessJsTask.js +0 -14
- package/lib-cjs/AutoPlayHeadlessJsTask.js +0 -16
- package/src/AutoPlayHeadlessJsTask.ts +0 -22
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
// Forward declaration of `NitroColor` to properly resolve imports.
|
|
32
32
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroColor; }
|
|
33
33
|
|
|
34
|
+
#include <string>
|
|
34
35
|
#include "NitroColor.hpp"
|
|
35
36
|
#include <optional>
|
|
36
|
-
#include <string>
|
|
37
37
|
|
|
38
38
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
39
39
|
|
|
@@ -42,16 +42,16 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
42
42
|
*/
|
|
43
43
|
struct AssetImage final {
|
|
44
44
|
public:
|
|
45
|
-
std::
|
|
46
|
-
bool packager_asset SWIFT_PRIVATE;
|
|
47
|
-
double height SWIFT_PRIVATE;
|
|
45
|
+
std::string uri SWIFT_PRIVATE;
|
|
48
46
|
double width SWIFT_PRIVATE;
|
|
47
|
+
double height SWIFT_PRIVATE;
|
|
49
48
|
double scale SWIFT_PRIVATE;
|
|
50
|
-
std::
|
|
49
|
+
std::optional<NitroColor> color SWIFT_PRIVATE;
|
|
50
|
+
bool packager_asset SWIFT_PRIVATE;
|
|
51
51
|
|
|
52
52
|
public:
|
|
53
53
|
AssetImage() = default;
|
|
54
|
-
explicit AssetImage(std::
|
|
54
|
+
explicit AssetImage(std::string uri, double width, double height, double scale, std::optional<NitroColor> color, bool packager_asset): uri(uri), width(width), height(height), scale(scale), color(color), packager_asset(packager_asset) {}
|
|
55
55
|
|
|
56
56
|
public:
|
|
57
57
|
friend bool operator==(const AssetImage& lhs, const AssetImage& rhs) = default;
|
|
@@ -67,22 +67,22 @@ namespace margelo::nitro {
|
|
|
67
67
|
static inline margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
68
68
|
jsi::Object obj = arg.asObject(runtime);
|
|
69
69
|
return margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage(
|
|
70
|
-
JSIConverter<std::
|
|
71
|
-
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "packager_asset"))),
|
|
72
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "height"))),
|
|
70
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uri"))),
|
|
73
71
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "width"))),
|
|
72
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "height"))),
|
|
74
73
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "scale"))),
|
|
75
|
-
JSIConverter<std::
|
|
74
|
+
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NitroColor>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "color"))),
|
|
75
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "packager_asset")))
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
78
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage& arg) {
|
|
79
79
|
jsi::Object obj(runtime);
|
|
80
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "
|
|
81
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "packager_asset"), JSIConverter<bool>::toJSI(runtime, arg.packager_asset));
|
|
82
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "height"), JSIConverter<double>::toJSI(runtime, arg.height));
|
|
80
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "uri"), JSIConverter<std::string>::toJSI(runtime, arg.uri));
|
|
83
81
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "width"), JSIConverter<double>::toJSI(runtime, arg.width));
|
|
82
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "height"), JSIConverter<double>::toJSI(runtime, arg.height));
|
|
84
83
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "scale"), JSIConverter<double>::toJSI(runtime, arg.scale));
|
|
85
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "
|
|
84
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "color"), JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NitroColor>>::toJSI(runtime, arg.color));
|
|
85
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "packager_asset"), JSIConverter<bool>::toJSI(runtime, arg.packager_asset));
|
|
86
86
|
return obj;
|
|
87
87
|
}
|
|
88
88
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -93,12 +93,12 @@ namespace margelo::nitro {
|
|
|
93
93
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
94
94
|
return false;
|
|
95
95
|
}
|
|
96
|
-
if (!JSIConverter<std::
|
|
97
|
-
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "packager_asset")))) return false;
|
|
98
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "height")))) return false;
|
|
96
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uri")))) return false;
|
|
99
97
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "width")))) return false;
|
|
98
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "height")))) return false;
|
|
100
99
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "scale")))) return false;
|
|
101
|
-
if (!JSIConverter<std::
|
|
100
|
+
if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NitroColor>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "color")))) return false;
|
|
101
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "packager_asset")))) return false;
|
|
102
102
|
return true;
|
|
103
103
|
}
|
|
104
104
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAutoPlayTimingSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridAutoPlayTimingSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
11
|
+
|
|
12
|
+
void HybridAutoPlayTimingSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("createTimer", &HybridAutoPlayTimingSpec::createTimer);
|
|
18
|
+
prototype.registerHybridMethod("deleteTimer", &HybridAutoPlayTimingSpec::deleteTimer);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAutoPlayTimingSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
#include <functional>
|
|
19
|
+
|
|
20
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
21
|
+
|
|
22
|
+
using namespace margelo::nitro;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* An abstract base class for `AutoPlayTiming`
|
|
26
|
+
* Inherit this class to create instances of `HybridAutoPlayTimingSpec` in C++.
|
|
27
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
28
|
+
* @example
|
|
29
|
+
* ```cpp
|
|
30
|
+
* class HybridAutoPlayTiming: public HybridAutoPlayTimingSpec {
|
|
31
|
+
* public:
|
|
32
|
+
* HybridAutoPlayTiming(...): HybridObject(TAG) { ... }
|
|
33
|
+
* // ...
|
|
34
|
+
* };
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
class HybridAutoPlayTimingSpec: public virtual HybridObject {
|
|
38
|
+
public:
|
|
39
|
+
// Constructor
|
|
40
|
+
explicit HybridAutoPlayTimingSpec(): HybridObject(TAG) { }
|
|
41
|
+
|
|
42
|
+
// Destructor
|
|
43
|
+
~HybridAutoPlayTimingSpec() override = default;
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
// Properties
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
// Methods
|
|
51
|
+
virtual double createTimer(const std::function<void()>& callback, double durationMs, bool repeats) = 0;
|
|
52
|
+
virtual void deleteTimer(double id) = 0;
|
|
53
|
+
|
|
54
|
+
protected:
|
|
55
|
+
// Hybrid Setup
|
|
56
|
+
void loadHybridMethods() override;
|
|
57
|
+
|
|
58
|
+
protected:
|
|
59
|
+
// Tag for logging
|
|
60
|
+
static constexpr auto TAG = "AutoPlayTiming";
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iternio/react-native-auto-play",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Android Auto and Apple CarPlay for react-native",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"module": "lib/index",
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
"lib",
|
|
15
15
|
"lib-cjs",
|
|
16
16
|
"jest.js",
|
|
17
|
+
"installTimers.ts",
|
|
18
|
+
"installTimers.web.ts",
|
|
17
19
|
"nitrogen",
|
|
18
20
|
"android/build.gradle",
|
|
19
21
|
"android/gradle.properties",
|
|
@@ -65,13 +67,13 @@
|
|
|
65
67
|
"@types/jest": "^29.5.12",
|
|
66
68
|
"@types/react": "~19.2.0",
|
|
67
69
|
"dpdm": "^4.0.1",
|
|
68
|
-
"nitrogen": "^0.
|
|
69
|
-
"typescript": "^
|
|
70
|
+
"nitrogen": "^0.37.1",
|
|
71
|
+
"typescript": "^6.0.3"
|
|
70
72
|
},
|
|
71
73
|
"peerDependencies": {
|
|
72
74
|
"react": "*",
|
|
73
75
|
"react-native": "*",
|
|
74
|
-
"react-native-nitro-modules": "
|
|
76
|
+
"react-native-nitro-modules": ">=0.37.1"
|
|
75
77
|
},
|
|
76
78
|
"dependencies": {
|
|
77
79
|
"react-native-uuid": "^2.0.3"
|
|
@@ -10,7 +10,7 @@ export const SafeAreaView = (props: ViewProps) => {
|
|
|
10
10
|
style={[
|
|
11
11
|
style,
|
|
12
12
|
{
|
|
13
|
-
...StyleSheet.
|
|
13
|
+
...StyleSheet.absoluteFill,
|
|
14
14
|
paddingTop: safeAreaInsets.top,
|
|
15
15
|
paddingBottom: safeAreaInsets.bottom,
|
|
16
16
|
paddingRight: safeAreaInsets.right,
|
|
@@ -30,8 +30,8 @@ const startVoiceInput: StartVoiceInput = async (options?: VoiceInputOptions) =>
|
|
|
30
30
|
const listeningImageRepeats =
|
|
31
31
|
listeningImage?.type === 'asset' ? listeningImage.repeats : undefined;
|
|
32
32
|
|
|
33
|
-
const startSoundUri = startSound != null ? Image.resolveAssetSource(startSound)
|
|
34
|
-
const endSoundUri = endSound != null ? Image.resolveAssetSource(endSound)
|
|
33
|
+
const startSoundUri = startSound != null ? Image.resolveAssetSource(startSound)?.uri : undefined;
|
|
34
|
+
const endSoundUri = endSound != null ? Image.resolveAssetSource(endSound)?.uri : undefined;
|
|
35
35
|
|
|
36
36
|
return await _native.startVoiceInput(
|
|
37
37
|
silenceThresholdMs,
|
package/src/index.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { Platform } from 'react-native';
|
|
2
2
|
import { NitroModules } from 'react-native-nitro-modules';
|
|
3
|
-
import AutoPlayHeadlessJsTask from './AutoPlayHeadlessJsTask';
|
|
4
3
|
import { HybridAndroidAutoTelemetry } from './hybrid/HybridAndroidAutoTelemetry';
|
|
5
4
|
import { HybridAndroidWindowInformation } from './hybrid/HybridAndroidWindowInformation';
|
|
6
5
|
import { HybridAutoPlay } from './hybrid/HybridAutoPlay';
|
|
7
6
|
import { HybridVoice } from './hybrid/HybridVoice';
|
|
8
7
|
import type { AndroidAutomotive } from './specs/AndroidAutomotive.nitro';
|
|
9
8
|
|
|
10
|
-
AutoPlayHeadlessJsTask.registerHeadlessTask(HybridAutoPlay);
|
|
11
|
-
|
|
12
9
|
export { HybridAndroidAutoTelemetry, HybridAndroidWindowInformation, HybridAutoPlay, HybridVoice };
|
|
13
10
|
|
|
14
11
|
export const HybridAndroidAutomotive =
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Side-effect-only entry point, re-exported at the package root as `installTimers` (see
|
|
2
|
+
// ../installTimers.ts) for `import '@iternio/react-native-auto-play/installTimers';` as the
|
|
3
|
+
// app's first import. installAutoPlayTimers() itself isn't part of the public API -- funneling
|
|
4
|
+
// installation through this one module is what actually guarantees "runs before anything else
|
|
5
|
+
// captures the original globals" (see the README) instead of just documenting it as a rule
|
|
6
|
+
// callers have to get right.
|
|
7
|
+
import { installAutoPlayTimers } from './utils/AutoPlayTimers';
|
|
8
|
+
|
|
9
|
+
installAutoPlayTimers();
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Backs setTimeout/setInterval with a scheduler that never pauses -- unlike RN's own JS
|
|
5
|
+
* timers, which RN throttles or pauses whenever the app backgrounds, regardless of whether
|
|
6
|
+
* the process is actually still running.
|
|
7
|
+
*
|
|
8
|
+
* iOS: CarPlay keeps this app's process alive and driving the external screen even when the
|
|
9
|
+
* phone's own screen is off, but RN's own RCTTiming still pauses in that state regardless.
|
|
10
|
+
*
|
|
11
|
+
* Android: JavaTimerManager only keeps ticking while the host is resumed *or* a headless JS
|
|
12
|
+
* task is running -- previously satisfied by registering a permanent no-op headless task
|
|
13
|
+
* (see AutoPlayHeadlessJsTask), which this replaces.
|
|
14
|
+
*
|
|
15
|
+
* All due-time bookkeeping lives here natively (mirroring RCTTiming's/JavaTimerManager's own
|
|
16
|
+
* architecture) so JS only crosses the bridge when a timer actually fires, not on every tick.
|
|
17
|
+
*/
|
|
18
|
+
export interface AutoPlayTiming extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> {
|
|
19
|
+
/**
|
|
20
|
+
* Schedules `callback` to run after `durationMs`, repeating every `durationMs` if `repeats`
|
|
21
|
+
* is true. Returns an id to pass to `deleteTimer`.
|
|
22
|
+
*/
|
|
23
|
+
createTimer(callback: () => void, durationMs: number, repeats: boolean): number;
|
|
24
|
+
deleteTimer(id: number): void;
|
|
25
|
+
}
|
package/src/types/Telemetry.ts
CHANGED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { HybridAutoPlayTiming } from '../hybrid/HybridAutoPlayTiming';
|
|
2
|
+
|
|
3
|
+
type TimerCallback = (...args: unknown[]) => void;
|
|
4
|
+
|
|
5
|
+
let installed = false;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Replaces the global `setTimeout`/`setInterval`/`clearTimeout`/`clearInterval` and
|
|
9
|
+
* `requestAnimationFrame`/`cancelAnimationFrame` with implementations backed by the native
|
|
10
|
+
* `AutoPlayTiming` module, so they keep running while the app is actively driving a car
|
|
11
|
+
* surface even though the phone itself is backgrounded or its screen is locked. React
|
|
12
|
+
* Native's own timers throttle or pause in that state regardless of whether the process is
|
|
13
|
+
* actually still alive, which would otherwise stall ETA updates and telemetry polling.
|
|
14
|
+
*
|
|
15
|
+
* `requestIdleCallback`/`cancelIdleCallback` are deliberately not covered: bridgeless RN
|
|
16
|
+
* backs those with a separate native module unrelated to `setTimeout`/`requestAnimationFrame`
|
|
17
|
+
* (and its own callback delivery path is an unimplemented stub on iOS), so there is nothing
|
|
18
|
+
* for this library to intercept there.
|
|
19
|
+
*
|
|
20
|
+
* All due-time bookkeeping happens natively -- this is a thin pass-through, so JS only
|
|
21
|
+
* crosses the bridge when a timer actually fires, not on some fixed interval.
|
|
22
|
+
*
|
|
23
|
+
* Call this **once**, as early as possible in your app -- ideally the first line of your
|
|
24
|
+
* entry file, before any other import -- so nothing else has already captured a reference to
|
|
25
|
+
* the original globals. Safe to call more than once; only the first call has any effect.
|
|
26
|
+
*/
|
|
27
|
+
export function installAutoPlayTimers(): void {
|
|
28
|
+
if (installed || HybridAutoPlayTiming == null) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
installed = true;
|
|
32
|
+
|
|
33
|
+
const timing = HybridAutoPlayTiming;
|
|
34
|
+
|
|
35
|
+
const schedule =
|
|
36
|
+
(repeats: boolean) =>
|
|
37
|
+
(callback: TimerCallback, delay?: number, ...args: unknown[]): number =>
|
|
38
|
+
timing.createTimer(() => callback(...args), delay ?? 0, repeats);
|
|
39
|
+
|
|
40
|
+
const clear = (id: unknown): void => {
|
|
41
|
+
if (typeof id === 'number') {
|
|
42
|
+
timing.deleteTimer(id);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
globalThis.setTimeout = schedule(false) as unknown as typeof setTimeout;
|
|
47
|
+
globalThis.setInterval = schedule(true) as unknown as typeof setInterval;
|
|
48
|
+
globalThis.clearTimeout = clear as unknown as typeof clearTimeout;
|
|
49
|
+
globalThis.clearInterval = clear as unknown as typeof clearInterval;
|
|
50
|
+
|
|
51
|
+
// Mirrors bridgeless RN's own implementation: requestAnimationFrame is setTimeout(0) with
|
|
52
|
+
// a performance.now() timestamp handed to the callback, and cancelAnimationFrame deletes
|
|
53
|
+
// the same underlying timer clearTimeout would.
|
|
54
|
+
const now = () =>
|
|
55
|
+
(globalThis as { performance?: { now(): number } }).performance?.now() ?? Date.now();
|
|
56
|
+
|
|
57
|
+
globalThis.requestAnimationFrame = ((callback: (timestamp: number) => void): number =>
|
|
58
|
+
timing.createTimer(() => callback(now()), 0, false)) as unknown as typeof requestAnimationFrame;
|
|
59
|
+
globalThis.cancelAnimationFrame = clear as unknown as typeof cancelAnimationFrame;
|
|
60
|
+
}
|
package/src/utils/NitroImage.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Image
|
|
1
|
+
import { Image } from 'react-native';
|
|
2
2
|
import type { AutoImage } from '../types/Image';
|
|
3
3
|
import { type NitroColor, NitroColorUtil } from './NitroColor';
|
|
4
4
|
|
|
@@ -64,7 +64,11 @@ function resolveGlyph(image: Extract<AutoImage, { type: 'glyph' }>): number {
|
|
|
64
64
|
throw new Error('Glyph image must provide either `name` or `codepoint`.');
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
interface AssetImage
|
|
67
|
+
interface AssetImage {
|
|
68
|
+
uri: string;
|
|
69
|
+
width: number;
|
|
70
|
+
height: number;
|
|
71
|
+
scale: number;
|
|
68
72
|
color?: NitroColor;
|
|
69
73
|
packager_asset: boolean;
|
|
70
74
|
}
|
|
@@ -119,7 +123,13 @@ function convert(image?: AutoImage): NitroImage | undefined {
|
|
|
119
123
|
// so the input allows all optional parameters which are returned as is even though
|
|
120
124
|
// the return type claims to not have any optional parameters...
|
|
121
125
|
// we specify some default values to not crash because of proper typing required by nitro-modules
|
|
122
|
-
const {
|
|
126
|
+
const {
|
|
127
|
+
height = 0,
|
|
128
|
+
scale = 0,
|
|
129
|
+
uri = '',
|
|
130
|
+
width = 0,
|
|
131
|
+
...rest
|
|
132
|
+
} = Image.resolveAssetSource(image.image) ?? {};
|
|
123
133
|
|
|
124
134
|
const assetImage: AssetImage = {
|
|
125
135
|
height,
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
package com.margelo.nitro.swe.iternio.reactnativeautoplay
|
|
2
|
-
|
|
3
|
-
import android.content.Intent
|
|
4
|
-
import android.os.Binder
|
|
5
|
-
import android.os.IBinder
|
|
6
|
-
import com.facebook.react.HeadlessJsTaskService
|
|
7
|
-
import com.facebook.react.bridge.Arguments
|
|
8
|
-
import com.facebook.react.bridge.UiThreadUtil
|
|
9
|
-
import com.facebook.react.jstasks.HeadlessJsTaskConfig
|
|
10
|
-
|
|
11
|
-
class HeadlessTaskService : HeadlessJsTaskService() {
|
|
12
|
-
// we use a bound service so it will never be killed when Android Auto is active
|
|
13
|
-
inner class LocalBinder : Binder() {
|
|
14
|
-
fun getService() = this@HeadlessTaskService
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
private val mBinder = LocalBinder()
|
|
18
|
-
|
|
19
|
-
override fun getTaskConfig(intent: Intent?): HeadlessJsTaskConfig {
|
|
20
|
-
val data = intent?.extras?.let {
|
|
21
|
-
Arguments.fromBundle(it)
|
|
22
|
-
} ?: Arguments.createMap()
|
|
23
|
-
|
|
24
|
-
return HeadlessJsTaskConfig(
|
|
25
|
-
taskKey = "AndroidAutoHeadlessJsTask", data = data, isAllowedInForeground = true
|
|
26
|
-
)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
override fun onBind(intent: Intent): IBinder? {
|
|
30
|
-
// Start the headless task when bound
|
|
31
|
-
UiThreadUtil.runOnUiThread {
|
|
32
|
-
startTask(getTaskConfig(intent))
|
|
33
|
-
}
|
|
34
|
-
return mBinder
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AppRegistry, Platform } from 'react-native';
|
|
2
|
-
const createTaskProvider = (hybridAutoPlay) => () => () => new Promise((resolve) => {
|
|
3
|
-
const remove = hybridAutoPlay.addListener('didDisconnect', () => {
|
|
4
|
-
resolve();
|
|
5
|
-
remove();
|
|
6
|
-
});
|
|
7
|
-
});
|
|
8
|
-
const registerHeadlessTask = (hybridAutoPlay) => {
|
|
9
|
-
if (Platform.OS !== 'android') {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
AppRegistry.registerHeadlessTask('AndroidAutoHeadlessJsTask', createTaskProvider(hybridAutoPlay));
|
|
13
|
-
};
|
|
14
|
-
export default { registerHeadlessTask };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const react_native_1 = require("react-native");
|
|
4
|
-
const createTaskProvider = (hybridAutoPlay) => () => () => new Promise((resolve) => {
|
|
5
|
-
const remove = hybridAutoPlay.addListener('didDisconnect', () => {
|
|
6
|
-
resolve();
|
|
7
|
-
remove();
|
|
8
|
-
});
|
|
9
|
-
});
|
|
10
|
-
const registerHeadlessTask = (hybridAutoPlay) => {
|
|
11
|
-
if (react_native_1.Platform.OS !== 'android') {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
react_native_1.AppRegistry.registerHeadlessTask('AndroidAutoHeadlessJsTask', createTaskProvider(hybridAutoPlay));
|
|
15
|
-
};
|
|
16
|
-
exports.default = { registerHeadlessTask };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { AppRegistry, Platform, type Task, type TaskProvider } from 'react-native';
|
|
2
|
-
import type { AutoPlay as NitroAutoPlay } from './specs/AutoPlay.nitro';
|
|
3
|
-
|
|
4
|
-
const createTaskProvider =
|
|
5
|
-
(hybridAutoPlay: NitroAutoPlay): TaskProvider =>
|
|
6
|
-
(): Task =>
|
|
7
|
-
() =>
|
|
8
|
-
new Promise((resolve) => {
|
|
9
|
-
const remove = hybridAutoPlay.addListener('didDisconnect', () => {
|
|
10
|
-
resolve();
|
|
11
|
-
remove();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const registerHeadlessTask = (hybridAutoPlay: NitroAutoPlay) => {
|
|
16
|
-
if (Platform.OS !== 'android') {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
AppRegistry.registerHeadlessTask('AndroidAutoHeadlessJsTask', createTaskProvider(hybridAutoPlay));
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default { registerHeadlessTask };
|