@entrig/react-native 0.0.1 → 0.0.2

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.
Files changed (113) hide show
  1. package/README.md +154 -49
  2. package/android/build/.transforms/013f3f34943d71cf3c3c03077862f6a9/results.bin +1 -0
  3. package/android/build/.transforms/013f3f34943d71cf3c3c03077862f6a9/transformed/classes/classes_dex/classes.dex +0 -0
  4. package/android/build/generated/source/buildConfig/debug/com/entrig/reactnative/BuildConfig.java +10 -0
  5. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +11 -0
  6. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
  7. package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
  8. package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
  9. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  10. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  11. package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
  12. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
  13. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  14. package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
  15. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  16. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  17. package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/entrig_react-native_debug.kotlin_module +0 -0
  18. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/entrig/reactnative/BuildConfig.class +0 -0
  19. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +2 -0
  20. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +17 -0
  21. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +11 -0
  22. package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
  23. package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
  24. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  25. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -0
  26. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  27. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  28. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  29. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  30. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  31. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  32. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  33. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  34. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  35. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  36. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  37. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  38. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  39. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  40. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  41. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  42. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  43. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  44. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  45. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  46. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  47. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  48. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  49. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  50. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  51. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  52. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  53. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  54. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  55. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  56. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  57. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  58. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  59. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  60. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  61. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  62. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  63. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  64. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  65. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  66. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  67. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  68. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  69. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  70. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  71. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  72. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  73. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  74. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  75. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  76. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  77. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  78. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  79. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  80. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  81. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  82. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
  83. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  84. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  85. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  86. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  87. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  88. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  89. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  90. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  91. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  92. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  93. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  94. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  95. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  96. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  97. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  98. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  99. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  100. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  101. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  102. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  103. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  104. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  105. package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  106. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  107. package/android/build/outputs/logs/manifest-merger-debug-report.txt +28 -0
  108. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  109. package/android/build/tmp/kotlin-classes/debug/META-INF/entrig_react-native_debug.kotlin_module +0 -0
  110. package/android/build/tmp/kotlin-classes/debug/com/entrig/reactnative/EntrigModule.class +0 -0
  111. package/android/build/tmp/kotlin-classes/debug/com/entrig/reactnative/EntrigPackage.class +0 -0
  112. package/package.json +1 -2
  113. package/plugin/withEntrig.js +38 -13
package/README.md CHANGED
@@ -50,7 +50,6 @@ Send push notifications to your React Native app, triggered by database events.
50
50
 
51
51
  </details>
52
52
 
53
- > **Note:** If you've configured iOS in your Firebase console, you can use FCM for both Android and iOS, which will skip the APNs setup step.
54
53
 
55
54
  4. **Upload APNs Key** (iOS) - Upload `.p8` key file with Team ID, Bundle ID, and Key ID to Entrig
56
55
 
@@ -105,30 +104,7 @@ No setup required for Android. We'll take care of it.
105
104
 
106
105
  ### iOS
107
106
 
108
- #### Expo (Managed Workflow)
109
-
110
- Add the plugin to your `app.json`:
111
-
112
- ```json
113
- {
114
- "expo": {
115
- "plugins": ["@entrig/react-native"]
116
- }
117
- }
118
- ```
119
-
120
- Then run prebuild:
121
-
122
- ```bash
123
- npx expo prebuild
124
- ```
125
-
126
- This automatically configures:
127
- - AppDelegate with Entrig notification handlers
128
- - Entitlements with push notification capabilities
129
- - Info.plist with background modes
130
-
131
- #### Bare React Native — Automatic Setup (Recommended)
107
+ #### React Native — Automatic Setup (Recommended)
132
108
 
133
109
  Run this command in your project root:
134
110
 
@@ -147,14 +123,14 @@ This automatically configures:
147
123
  <details>
148
124
  <summary>Manual AppDelegate setup (click to expand)</summary>
149
125
 
150
- #### 1. Enable Push Notifications in Xcode
126
+ ##### 1. Enable Push Notifications in Xcode
151
127
 
152
128
  - Open `ios/YourApp.xcworkspace`
153
129
  - Select your target → Signing & Capabilities
154
130
  - Click `+ Capability` → Push Notifications
155
131
  - Click `+ Capability` → Background Modes → Enable `Remote notifications`
156
132
 
157
- #### 2. Update AppDelegate.swift
133
+ ##### 2. Update AppDelegate.swift
158
134
 
159
135
  Add `import UserNotifications` and `import EntrigSDK`, add `UNUserNotificationCenterDelegate` conformance, then add the notification methods.
160
136
 
@@ -267,6 +243,157 @@ class AppDelegate: RCTAppDelegate, UNUserNotificationCenterDelegate {
267
243
 
268
244
  </details>
269
245
 
246
+
247
+ #### Expo (Managed Workflow)
248
+
249
+ **Step 1: Add the config plugin**
250
+
251
+ Add the plugin to your `app.json`:
252
+
253
+ ```json
254
+ {
255
+ "expo": {
256
+ "plugins": ["@entrig/react-native"]
257
+ }
258
+ }
259
+ ```
260
+
261
+ **Step 2: Run prebuild**
262
+
263
+ ```bash
264
+ npx expo prebuild
265
+ # or
266
+ npx expo run:ios
267
+ npx expo run:android
268
+ ```
269
+
270
+ The plugin automatically configures:
271
+ - ✅ AppDelegate with Entrig notification handlers (supports Expo SDK 54+)
272
+ - ✅ Info.plist with background modes (`UIBackgroundModes: ["remote-notification"]`)
273
+ - ✅ Entitlements with push capabilities (`aps-environment: development`)
274
+
275
+ **Step 3: Verify configuration (Important!)**
276
+
277
+ After prebuild, verify the plugin worked correctly:
278
+
279
+ 1. **Check AppDelegate** (`ios/YourApp/AppDelegate.swift`):
280
+ - Should have `import EntrigSDK` and `import UserNotifications`
281
+ - Should have `UNUserNotificationCenterDelegate` conformance
282
+ - Should have Entrig notification methods
283
+
284
+ 2. **Check Info.plist** (`ios/YourApp/Info.plist`):
285
+ ```xml
286
+ <key>UIBackgroundModes</key>
287
+ <array>
288
+ <string>remote-notification</string>
289
+ </array>
290
+ ```
291
+
292
+ 3. **Check Entitlements** (`ios/YourApp/YourApp.entitlements`):
293
+ ```xml
294
+ <key>aps-environment</key>
295
+ <string>development</string>
296
+ ```
297
+
298
+ <details>
299
+ <summary><b>If the plugin didn't work (manual setup)</b></summary>
300
+
301
+ If any of the above are missing after prebuild, add them manually:
302
+
303
+ **1. Update AppDelegate.swift**
304
+
305
+ Add imports at the top:
306
+ ```swift
307
+ import UserNotifications
308
+ import EntrigSDK
309
+ ```
310
+
311
+ Add `UNUserNotificationCenterDelegate` to class declaration:
312
+ ```swift
313
+ public class AppDelegate: ExpoAppDelegate, UNUserNotificationCenterDelegate {
314
+ ```
315
+
316
+ Add setup in `didFinishLaunchingWithOptions` (right after the function opens):
317
+ ```swift
318
+ public override func application(
319
+ _ application: UIApplication,
320
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
321
+ ) -> Bool {
322
+ // Entrig: Setup push notification handling
323
+ UNUserNotificationCenter.current().delegate = self
324
+ Entrig.checkLaunchNotification(launchOptions)
325
+
326
+ // ... rest of existing code
327
+ }
328
+ ```
329
+
330
+ Add notification methods before the closing brace `}` of AppDelegate:
331
+ ```swift
332
+ // MARK: - Entrig Push Notification Handling
333
+
334
+ public override func application(
335
+ _ application: UIApplication,
336
+ didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data
337
+ ) {
338
+ Entrig.didRegisterForRemoteNotifications(deviceToken: deviceToken)
339
+ super.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
340
+ }
341
+
342
+ public override func application(
343
+ _ application: UIApplication,
344
+ didFailToRegisterForRemoteNotificationsWithError error: Error
345
+ ) {
346
+ Entrig.didFailToRegisterForRemoteNotifications(error: error)
347
+ super.application(application, didFailToRegisterForRemoteNotificationsWithError: error)
348
+ }
349
+
350
+ public func userNotificationCenter(
351
+ _ center: UNUserNotificationCenter,
352
+ willPresent notification: UNNotification,
353
+ withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void
354
+ ) {
355
+ Entrig.willPresentNotification(notification)
356
+ completionHandler(Entrig.getPresentationOptions())
357
+ }
358
+
359
+ public func userNotificationCenter(
360
+ _ center: UNUserNotificationCenter,
361
+ didReceive response: UNNotificationResponse,
362
+ withCompletionHandler completionHandler: @escaping () -> Void
363
+ ) {
364
+ Entrig.didReceiveNotification(response)
365
+ completionHandler()
366
+ }
367
+ ```
368
+
369
+ **2. Update Info.plist** (`ios/YourApp/Info.plist`)
370
+
371
+ Add this before the closing `</dict>` tag:
372
+ ```xml
373
+ <key>UIBackgroundModes</key>
374
+ <array>
375
+ <string>remote-notification</string>
376
+ </array>
377
+ ```
378
+
379
+ **3. Update Entitlements** (`ios/YourApp/YourApp.entitlements`)
380
+
381
+ Replace the contents with:
382
+ ```xml
383
+ <?xml version="1.0" encoding="UTF-8"?>
384
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
385
+ <plist version="1.0">
386
+ <dict>
387
+ <key>aps-environment</key>
388
+ <string>development</string>
389
+ </dict>
390
+ </plist>
391
+ ```
392
+
393
+ > **Note:** Change `development` to `production` for App Store releases.
394
+
395
+ </details>
396
+
270
397
  ---
271
398
 
272
399
  ## Troubleshooting
@@ -306,28 +433,6 @@ Then rebuild. Also ensure:
306
433
 
307
434
  </details>
308
435
 
309
- <details>
310
- <summary>Cannot read Config / env variables undefined</summary>
311
-
312
- `react-native-config` requires native setup on both platforms. The simplest alternative is [`react-native-dotenv`](https://github.com/goatandsheep/react-native-dotenv) (a Babel plugin — no native setup needed):
313
-
314
- ```bash
315
- npm install react-native-dotenv
316
- ```
317
-
318
- Add to `babel.config.js`:
319
- ```js
320
- module.exports = {
321
- plugins: [['module:react-native-dotenv']]
322
- };
323
- ```
324
-
325
- Then import:
326
- ```ts
327
- import { ENTRIG_API_KEY } from '@env';
328
- ```
329
-
330
- </details>
331
436
 
332
437
  <details>
333
438
  <summary>pod install CocoaPods dependency errors</summary>
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Automatically generated file. DO NOT MODIFY
3
+ */
4
+ package com.entrig.reactnative;
5
+
6
+ public final class BuildConfig {
7
+ public static final boolean DEBUG = Boolean.parseBoolean("true");
8
+ public static final String LIBRARY_PACKAGE_NAME = "com.entrig.reactnative";
9
+ public static final String BUILD_TYPE = "debug";
10
+ }
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ package="com.entrig.reactnative" >
4
+
5
+ <uses-sdk android:minSdkVersion="24" />
6
+ <!-- Permissions for push notifications -->
7
+ <uses-permission android:name="android.permission.INTERNET" />
8
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
9
+ <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
10
+
11
+ </manifest>
@@ -0,0 +1,18 @@
1
+ {
2
+ "version": 3,
3
+ "artifactType": {
4
+ "type": "AAPT_FRIENDLY_MERGED_MANIFESTS",
5
+ "kind": "Directory"
6
+ },
7
+ "applicationId": "com.entrig.reactnative",
8
+ "variantName": "debug",
9
+ "elements": [
10
+ {
11
+ "type": "SINGLE",
12
+ "filters": [],
13
+ "attributes": [],
14
+ "outputFile": "AndroidManifest.xml"
15
+ }
16
+ ],
17
+ "elementType": "File"
18
+ }
@@ -0,0 +1,6 @@
1
+ aarFormatVersion=1.0
2
+ aarMetadataVersion=1.0
3
+ minCompileSdk=1
4
+ minCompileSdkExtension=0
5
+ minAndroidGradlePluginVersion=1.0.0
6
+ coreLibraryDesugaringEnabled=false
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="generated$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="generated" generated-set="generated$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/build/generated/res/resValues/debug"/></dataSet><mergedItems/></merger>
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/assets"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/debug/assets"/></dataSet><dataSet config="generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/build/intermediates/shader_assets/debug/compileDebugShaders/out"/></dataSet></merger>
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/debug/jniLibs"/></dataSet></merger>
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/debug/shaders"/></dataSet></merger>
@@ -0,0 +1,2 @@
1
+ R_DEF: Internal format may change without notice
2
+ local
@@ -0,0 +1,17 @@
1
+ 1<?xml version="1.0" encoding="utf-8"?>
2
+ 2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ 3 package="com.entrig.reactnative" >
4
+ 4
5
+ 5 <uses-sdk android:minSdkVersion="24" />
6
+ 6 <!-- Permissions for push notifications -->
7
+ 7 <uses-permission android:name="android.permission.INTERNET" />
8
+ 7-->/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml:4:3-65
9
+ 7-->/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml:4:20-62
10
+ 8 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
11
+ 8-->/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml:5:3-77
12
+ 8-->/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml:5:20-74
13
+ 9 <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
14
+ 9-->/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml:6:3-75
15
+ 9-->/Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml:6:20-72
16
+ 10
17
+ 11</manifest>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ package="com.entrig.reactnative" >
4
+
5
+ <uses-sdk android:minSdkVersion="24" />
6
+ <!-- Permissions for push notifications -->
7
+ <uses-permission android:name="android.permission.INTERNET" />
8
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
9
+ <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
10
+
11
+ </manifest>
@@ -0,0 +1,28 @@
1
+ -- Merging decision tree log ---
2
+ manifest
3
+ ADDED from /Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml:2:1-7:12
4
+ INJECTED from /Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml:2:1-7:12
5
+ package
6
+ INJECTED from /Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml
7
+ xmlns:android
8
+ ADDED from /Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml:2:11-69
9
+ uses-permission#android.permission.INTERNET
10
+ ADDED from /Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml:4:3-65
11
+ android:name
12
+ ADDED from /Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml:4:20-62
13
+ uses-permission#android.permission.ACCESS_NETWORK_STATE
14
+ ADDED from /Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml:5:3-77
15
+ android:name
16
+ ADDED from /Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml:5:20-74
17
+ uses-permission#android.permission.POST_NOTIFICATIONS
18
+ ADDED from /Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml:6:3-75
19
+ android:name
20
+ ADDED from /Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml:6:20-72
21
+ uses-sdk
22
+ INJECTED from /Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml reason: use-sdk injection requested
23
+ INJECTED from /Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml
24
+ INJECTED from /Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml
25
+ android:targetSdkVersion
26
+ INJECTED from /Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml
27
+ android:minSdkVersion
28
+ INJECTED from /Volumes/Dev/entrig-project/entrig_packages/entrig-react-native/android/src/main/AndroidManifest.xml
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entrig/react-native",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Entrig | Push Notifications for Supabase",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -45,7 +45,6 @@
45
45
  "license": "MIT",
46
46
  "homepage": "https://github.com/entrig/entrig-react-native#readme",
47
47
  "devDependencies": {
48
- "@expo/config-plugins": "^54.0.4",
49
48
  "@types/react": "^19.0.0",
50
49
  "typescript": "^5.0.0"
51
50
  },
@@ -88,6 +88,9 @@ function patchSwiftAppDelegate(filePath) {
88
88
  return;
89
89
  }
90
90
 
91
+ // Detect if this is an Expo SDK 54+ AppDelegate (inherits from ExpoAppDelegate)
92
+ const isExpoSDK54 = content.includes('ExpoAppDelegate');
93
+
91
94
  // 1. Add imports
92
95
  if (!content.includes('import UserNotifications')) {
93
96
  const importMatch = content.match(/^import \w+/m);
@@ -111,7 +114,11 @@ function patchSwiftAppDelegate(filePath) {
111
114
 
112
115
  // 2. Add UNUserNotificationCenterDelegate conformance to the class
113
116
  if (!content.includes('UNUserNotificationCenterDelegate')) {
114
- const classPattern = /(class\s+AppDelegate\s*:\s*[^{]+)\{/;
117
+ // For Expo SDK 54+, match pattern like: public class AppDelegate: ExpoAppDelegate {
118
+ // For older RN/Expo, match pattern like: class AppDelegate: UIResponder, UIApplicationDelegate {
119
+ const classPattern = isExpoSDK54
120
+ ? /(public\s+class\s+AppDelegate\s*:\s*ExpoAppDelegate)\s*\{/
121
+ : /(class\s+AppDelegate\s*:\s*[^{]+)\{/;
115
122
  const classMatch = content.match(classPattern);
116
123
  if (classMatch) {
117
124
  const declaration = classMatch[1].trimEnd();
@@ -124,9 +131,17 @@ function patchSwiftAppDelegate(filePath) {
124
131
 
125
132
  // 3. Add setup code inside didFinishLaunchingWithOptions
126
133
  if (!content.includes('Entrig.checkLaunchNotification')) {
134
+ // Pattern matches both old and new Expo formats (with/without override keyword and multiline)
127
135
  const didFinishPattern =
128
- /func application\(\s*_\s+application:\s*UIApplication,\s*didFinishLaunchingWithOptions\s+launchOptions:[^)]*\)\s*->\s*Bool\s*\{/s;
129
- const didFinishMatch = content.match(didFinishPattern);
136
+ /(public\s+)?override\s+func\s+application\(\s*_\s+application:\s*UIApplication,\s*didFinishLaunchingWithOptions\s+launchOptions:[^)]*\)\s*->\s*Bool\s*\{/s;
137
+ let didFinishMatch = content.match(didFinishPattern);
138
+
139
+ // Fallback for older format without override
140
+ if (!didFinishMatch) {
141
+ didFinishMatch = content.match(
142
+ /func\s+application\(\s*_\s+application:\s*UIApplication,\s*didFinishLaunchingWithOptions\s+launchOptions:[^)]*\)\s*->\s*Bool\s*\{/s
143
+ );
144
+ }
130
145
 
131
146
  if (didFinishMatch) {
132
147
  const insertPos = didFinishMatch.index + didFinishMatch[0].length;
@@ -141,31 +156,41 @@ function patchSwiftAppDelegate(filePath) {
141
156
 
142
157
  // 4. Add delegate methods before the closing brace of the AppDelegate class
143
158
  if (!content.includes('didRegisterForRemoteNotificationsWithDeviceToken')) {
159
+ // Use 'public' keyword for Expo SDK 54+
160
+ const publicKeyword = isExpoSDK54 ? 'public ' : '';
144
161
  const delegateMethods = `
145
162
  // MARK: - Entrig Push Notification Handling
146
163
 
147
- override func application(_ application: UIApplication,
148
- didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
164
+ ${publicKeyword}override func application(
165
+ _ application: UIApplication,
166
+ didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data
167
+ ) {
149
168
  Entrig.didRegisterForRemoteNotifications(deviceToken: deviceToken)
150
169
  super.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
151
170
  }
152
171
 
153
- override func application(_ application: UIApplication,
154
- didFailToRegisterForRemoteNotificationsWithError error: Error) {
172
+ ${publicKeyword}override func application(
173
+ _ application: UIApplication,
174
+ didFailToRegisterForRemoteNotificationsWithError error: Error
175
+ ) {
155
176
  Entrig.didFailToRegisterForRemoteNotifications(error: error)
156
177
  super.application(application, didFailToRegisterForRemoteNotificationsWithError: error)
157
178
  }
158
179
 
159
- func userNotificationCenter(_ center: UNUserNotificationCenter,
160
- willPresent notification: UNNotification,
161
- withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
180
+ ${publicKeyword}func userNotificationCenter(
181
+ _ center: UNUserNotificationCenter,
182
+ willPresent notification: UNNotification,
183
+ withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void
184
+ ) {
162
185
  Entrig.willPresentNotification(notification)
163
186
  completionHandler(Entrig.getPresentationOptions())
164
187
  }
165
188
 
166
- func userNotificationCenter(_ center: UNUserNotificationCenter,
167
- didReceive response: UNNotificationResponse,
168
- withCompletionHandler completionHandler: @escaping () -> Void) {
189
+ ${publicKeyword}func userNotificationCenter(
190
+ _ center: UNUserNotificationCenter,
191
+ didReceive response: UNNotificationResponse,
192
+ withCompletionHandler completionHandler: @escaping () -> Void
193
+ ) {
169
194
  Entrig.didReceiveNotification(response)
170
195
  completionHandler()
171
196
  }