@iternio/react-native-auto-play 0.4.1 → 0.4.3

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.
@@ -8,7 +8,6 @@ import java.util.concurrent.CopyOnWriteArrayList
8
8
  class HybridCluster : HybridClusterSpec() {
9
9
  init {
10
10
  listeners.clear()
11
- eventQueue.clear()
12
11
  colorSchemeListeners.clear()
13
12
  }
14
13
 
@@ -60,12 +60,17 @@ export const useAndroidAutoTelemetry = ({ requestTelemetryPermissions = true, re
60
60
  return;
61
61
  }
62
62
  if (automotivePermissionRequest?.message != null) {
63
- HybridAndroidAutoTelemetry?.requestAutomotivePermissions(requiredPermissions, automotivePermissionRequest.message, automotivePermissionRequest.grantButtonText, automotivePermissionRequest.cancelButtonText).then(({ granted, denied }) => {
63
+ HybridAndroidAutoTelemetry?.requestAutomotivePermissions(requiredPermissions, automotivePermissionRequest.message, automotivePermissionRequest.grantButtonText, automotivePermissionRequest.cancelButtonText)
64
+ .then(({ granted, denied }) => {
64
65
  const isGranted = granted.length === requiredPermissions.length;
65
66
  setPermissionsGranted(isGranted);
66
67
  if (!isGranted) {
67
68
  setError(`Android Automotive permissions denied: [${denied.join(',')}]`);
68
69
  }
70
+ })
71
+ .catch((e) => {
72
+ const message = e instanceof Error ? e.message : String(e);
73
+ setError(message);
69
74
  });
70
75
  return;
71
76
  }
package/lib/index.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import { HybridAndroidAutoTelemetry } from './hybrid/HybridAndroidAutoTelemetry';
2
2
  import { HybridAutoPlay } from './hybrid/HybridAutoPlay';
3
3
  import type { AndroidAutomotive } from './specs/AndroidAutomotive.nitro';
4
- export { HybridAutoPlay };
5
- export { HybridAndroidAutoTelemetry };
4
+ export { HybridAndroidAutoTelemetry, HybridAutoPlay };
6
5
  export declare const HybridAndroidAutomotive: AndroidAutomotive | null;
7
6
  /**
8
7
  * These are the static module names for the app running on the mobile device, head unit screen and the CarPlay dashboard.
package/lib/index.js CHANGED
@@ -4,8 +4,7 @@ import AutoPlayHeadlessJsTask from './AutoPlayHeadlessJsTask';
4
4
  import { HybridAndroidAutoTelemetry } from './hybrid/HybridAndroidAutoTelemetry';
5
5
  import { HybridAutoPlay } from './hybrid/HybridAutoPlay';
6
6
  AutoPlayHeadlessJsTask.registerHeadlessTask(HybridAutoPlay);
7
- export { HybridAutoPlay };
8
- export { HybridAndroidAutoTelemetry };
7
+ export { HybridAndroidAutoTelemetry, HybridAutoPlay };
9
8
  export const HybridAndroidAutomotive = Platform.OS === 'android'
10
9
  ? NitroModules.createHybridObject('AndroidAutomotive')
11
10
  : null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iternio/react-native-auto-play",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Android Auto and Apple CarPlay for react-native",
5
5
  "main": "lib/index",
6
6
  "module": "lib/index",
@@ -131,14 +131,19 @@ export const useAndroidAutoTelemetry = ({
131
131
  automotivePermissionRequest.message,
132
132
  automotivePermissionRequest.grantButtonText,
133
133
  automotivePermissionRequest.cancelButtonText
134
- ).then(({ granted, denied }) => {
135
- const isGranted = granted.length === requiredPermissions.length;
136
- setPermissionsGranted(isGranted);
137
-
138
- if (!isGranted) {
139
- setError(`Android Automotive permissions denied: [${denied.join(',')}]`);
140
- }
141
- });
134
+ )
135
+ .then(({ granted, denied }) => {
136
+ const isGranted = granted.length === requiredPermissions.length;
137
+ setPermissionsGranted(isGranted);
138
+
139
+ if (!isGranted) {
140
+ setError(`Android Automotive permissions denied: [${denied.join(',')}]`);
141
+ }
142
+ })
143
+ .catch((e) => {
144
+ const message = e instanceof Error ? e.message : String(e);
145
+ setError(message);
146
+ });
142
147
  return;
143
148
  }
144
149
 
package/src/index.ts CHANGED
@@ -7,8 +7,7 @@ import type { AndroidAutomotive } from './specs/AndroidAutomotive.nitro';
7
7
 
8
8
  AutoPlayHeadlessJsTask.registerHeadlessTask(HybridAutoPlay);
9
9
 
10
- export { HybridAutoPlay };
11
- export { HybridAndroidAutoTelemetry };
10
+ export { HybridAndroidAutoTelemetry, HybridAutoPlay };
12
11
 
13
12
  export const HybridAndroidAutomotive =
14
13
  Platform.OS === 'android'