@entrig/expo 0.0.1 → 0.0.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/README.md +28 -4
- package/bin/setup.js +7 -20
- package/expo-module.config.json +10 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -24,6 +24,12 @@ Send push notifications to your React Native/Expo app, triggered by database eve
|
|
|
24
24
|
npm install @entrig/expo
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
**Bare React Native projects** also need to install Expo modules if not already set up:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx install-expo-modules
|
|
31
|
+
```
|
|
32
|
+
|
|
27
33
|
---
|
|
28
34
|
|
|
29
35
|
## Platform Setup
|
|
@@ -34,19 +40,37 @@ No setup required for Android.
|
|
|
34
40
|
|
|
35
41
|
### iOS
|
|
36
42
|
|
|
37
|
-
Run
|
|
43
|
+
Run from your project root:
|
|
38
44
|
|
|
39
45
|
```bash
|
|
40
|
-
npx expo prebuild
|
|
41
46
|
npx @entrig/expo setup ios
|
|
42
47
|
```
|
|
43
48
|
|
|
44
49
|
This automatically configures:
|
|
45
|
-
- Entitlements with push
|
|
46
|
-
- Info.plist with background
|
|
50
|
+
- Entitlements with `aps-environment` for push notifications
|
|
51
|
+
- Info.plist with `remote-notification` background mode
|
|
47
52
|
|
|
48
53
|
> **Note:** The command creates `.backup` files for safety.
|
|
49
54
|
|
|
55
|
+
#### Expo managed projects
|
|
56
|
+
|
|
57
|
+
Expo managed projects don't have an `ios/` directory by default. Generate it first:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx expo prebuild
|
|
61
|
+
npx @entrig/expo setup ios
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
> **Important:** If you re-run `npx expo prebuild`, the native `ios/` directory is regenerated and these changes will be lost. You'll need to run `npx @entrig/expo setup ios` again after each prebuild.
|
|
65
|
+
|
|
66
|
+
#### Bare React Native projects
|
|
67
|
+
|
|
68
|
+
Bare RN projects already have an `ios/` directory, so run the setup command directly:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npx @entrig/expo setup ios
|
|
72
|
+
```
|
|
73
|
+
|
|
50
74
|
<details>
|
|
51
75
|
<summary>Troubleshooting pod install issues (click to expand)</summary>
|
|
52
76
|
|
package/bin/setup.js
CHANGED
|
@@ -21,27 +21,14 @@ if (!fs.existsSync(iosDir)) {
|
|
|
21
21
|
process.exit(1);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
// Find the app
|
|
24
|
+
// Find the app directory in ios/
|
|
25
25
|
let appName = null;
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
// ignore
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Try to find the app directory in ios/
|
|
37
|
-
if (!appName) {
|
|
38
|
-
const iosDirs = fs.readdirSync(iosDir).filter((f) => {
|
|
39
|
-
const stat = fs.statSync(path.join(iosDir, f));
|
|
40
|
-
return stat.isDirectory() && !f.startsWith(".") && f !== "Pods" && f !== "build";
|
|
41
|
-
});
|
|
42
|
-
if (iosDirs.length > 0) {
|
|
43
|
-
appName = iosDirs[0];
|
|
44
|
-
}
|
|
26
|
+
const iosDirs = fs.readdirSync(iosDir).filter((f) => {
|
|
27
|
+
const stat = fs.statSync(path.join(iosDir, f));
|
|
28
|
+
return stat.isDirectory() && !f.startsWith(".") && f !== "Pods" && f !== "build";
|
|
29
|
+
});
|
|
30
|
+
if (iosDirs.length > 0) {
|
|
31
|
+
appName = iosDirs[0];
|
|
45
32
|
}
|
|
46
33
|
|
|
47
34
|
if (!appName) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entrig/expo",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Entrig | Push Notifications for Supabase",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"ios/",
|
|
13
13
|
"android/",
|
|
14
14
|
"bin/",
|
|
15
|
-
"src/"
|
|
15
|
+
"src/",
|
|
16
|
+
"expo-module.config.json"
|
|
16
17
|
],
|
|
17
18
|
"scripts": {
|
|
18
19
|
"build": "expo-module build",
|