@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 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 this command in your project root:
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 notification settings
46
- - Info.plist with background modes
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 name from app.json
24
+ // Find the app directory in ios/
25
25
  let appName = null;
26
- const appJsonPath = path.join(process.cwd(), "app.json");
27
- if (fs.existsSync(appJsonPath)) {
28
- try {
29
- const appJson = JSON.parse(fs.readFileSync(appJsonPath, "utf8"));
30
- appName = appJson.expo?.name || appJson.name;
31
- } catch (e) {
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) {
@@ -0,0 +1,10 @@
1
+ {
2
+ "platforms": ["apple", "android", "web"],
3
+ "apple": {
4
+ "modules": ["EntrigModule"],
5
+ "appDelegateSubscribers": ["EntrigAppDelegateSubscriber"]
6
+ },
7
+ "android": {
8
+ "modules": ["expo.modules.entrig.EntrigModule"]
9
+ }
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entrig/expo",
3
- "version": "0.0.1",
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",