react-native-update 10.5.3 → 10.5.4
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/package.json +1 -1
- package/src/client.ts +4 -2
- package/src/core.ts +2 -2
- package/src/permissions.ts +2 -2
- package/src/provider.tsx +3 -0
- package/src/utils.ts +2 -1
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -50,8 +50,10 @@ export class Pushy {
|
|
|
50
50
|
version = cInfo.pushy;
|
|
51
51
|
|
|
52
52
|
constructor(options: PushyOptions) {
|
|
53
|
-
if (
|
|
54
|
-
|
|
53
|
+
if (Platform.OS === 'ios' || Platform.OS === 'android') {
|
|
54
|
+
if (!options.appKey) {
|
|
55
|
+
throw new Error('appKey is required');
|
|
56
|
+
}
|
|
55
57
|
}
|
|
56
58
|
this.setOptions(options);
|
|
57
59
|
}
|
package/src/core.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
|
|
2
|
-
import {
|
|
2
|
+
import { emptyModule, log } from './utils';
|
|
3
3
|
const {
|
|
4
4
|
version: v,
|
|
5
5
|
} = require('react-native/Libraries/Core/ReactNativeVersion');
|
|
@@ -10,7 +10,7 @@ const isTurboModuleEnabled =
|
|
|
10
10
|
|
|
11
11
|
export const PushyModule =
|
|
12
12
|
Platform.OS === 'web'
|
|
13
|
-
?
|
|
13
|
+
? emptyModule
|
|
14
14
|
: isTurboModuleEnabled
|
|
15
15
|
? require('./NativePushy').default
|
|
16
16
|
: NativeModules.Pushy;
|
package/src/permissions.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { PermissionsAndroidStatic } from 'react-native';
|
|
2
|
-
import {
|
|
2
|
+
import { emptyModule } from './utils';
|
|
3
3
|
|
|
4
|
-
export const PermissionsAndroid =
|
|
4
|
+
export const PermissionsAndroid = emptyModule as PermissionsAndroidStatic;
|
package/src/provider.tsx
CHANGED
package/src/utils.ts
CHANGED
|
@@ -5,7 +5,7 @@ export function log(...args: any[]) {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
const noop = () => {};
|
|
8
|
-
|
|
8
|
+
class EmptyModule {
|
|
9
9
|
constructor() {
|
|
10
10
|
return new Proxy(this, {
|
|
11
11
|
get() {
|
|
@@ -14,6 +14,7 @@ export class EmptyModule {
|
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
+
export const emptyModule = new EmptyModule();
|
|
17
18
|
|
|
18
19
|
const ping =
|
|
19
20
|
Platform.OS === 'web'
|