@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.
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridCluster.kt +0 -1
- package/lib/hooks/useAndroidAutoTelemetry.js +6 -1
- package/lib/index.d.ts +1 -2
- package/lib/index.js +1 -2
- package/package.json +1 -1
- package/src/hooks/useAndroidAutoTelemetry.ts +13 -8
- package/src/index.ts +1 -2
|
@@ -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)
|
|
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
|
@@ -131,14 +131,19 @@ export const useAndroidAutoTelemetry = ({
|
|
|
131
131
|
automotivePermissionRequest.message,
|
|
132
132
|
automotivePermissionRequest.grantButtonText,
|
|
133
133
|
automotivePermissionRequest.cancelButtonText
|
|
134
|
-
)
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
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'
|