@secondts/bark-react-native 0.26.0 → 0.26.1
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 +4 -12
- package/android/CMakeLists.txt +1 -1
- package/android/build.gradle +1 -1
- package/android/proguard-rules.pro +16 -0
- package/app.plugin.js +5 -1
- package/lib/commonjs/WalletNotifications.js +7 -2
- package/lib/commonjs/WalletNotifications.js.map +1 -1
- package/lib/commonjs/generated/bark-ffi.js.map +1 -1
- package/lib/commonjs/generated/bark.js +702 -702
- package/lib/commonjs/generated/bark.js.map +1 -1
- package/lib/module/WalletNotifications.js +7 -2
- package/lib/module/WalletNotifications.js.map +1 -1
- package/lib/module/generated/bark-ffi.js.map +1 -1
- package/lib/module/generated/bark.js +702 -702
- package/lib/module/generated/bark.js.map +1 -1
- package/lib/typescript/commonjs/src/WalletNotifications.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts +1 -1
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark.d.ts +20 -14
- package/lib/typescript/commonjs/src/generated/bark.d.ts.map +1 -1
- package/lib/typescript/module/src/WalletNotifications.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark-ffi.d.ts +1 -1
- package/lib/typescript/module/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark.d.ts +20 -14
- package/lib/typescript/module/src/generated/bark.d.ts.map +1 -1
- package/package.json +5 -10
- package/scripts/postinstall.js +92 -31
- package/src/WalletNotifications.ts +7 -2
- package/src/generated/bark-ffi.ts +396 -1022
- package/src/generated/bark.ts +11978 -14893
- package/lib/typescript/commonjs/plugin/src/index.d.ts +0 -11
- package/lib/typescript/commonjs/plugin/src/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts +0 -6
- package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts.map +0 -1
- package/lib/typescript/commonjs/plugin/src/withIOS.d.ts +0 -7
- package/lib/typescript/commonjs/plugin/src/withIOS.d.ts.map +0 -1
- package/lib/typescript/module/plugin/src/index.d.ts +0 -11
- package/lib/typescript/module/plugin/src/index.d.ts.map +0 -1
- package/lib/typescript/module/plugin/src/withAndroid.d.ts +0 -6
- package/lib/typescript/module/plugin/src/withAndroid.d.ts.map +0 -1
- package/lib/typescript/module/plugin/src/withIOS.d.ts +0 -7
- package/lib/typescript/module/plugin/src/withIOS.d.ts.map +0 -1
- package/plugin/build/index.d.ts +0 -10
- package/plugin/build/index.js +0 -16
- package/plugin/build/withAndroid.d.ts +0 -5
- package/plugin/build/withAndroid.js +0 -26
- package/plugin/build/withIOS.d.ts +0 -6
- package/plugin/build/withIOS.js +0 -13
- package/plugin/tsconfig.json +0 -9
- package/plugin/tsconfig.tsbuildinfo +0 -1
package/README.md
CHANGED
|
@@ -21,19 +21,9 @@ Requires React Native 0.75+ (Expo SDK 52+) with the New Architecture enabled and
|
|
|
21
21
|
npx expo install @secondts/bark-react-native
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
2. Add the plugin to `app.json` or `app.config.js`:
|
|
25
|
-
|
|
26
|
-
```json
|
|
27
|
-
{
|
|
28
|
-
"expo": {
|
|
29
|
-
"plugins": ["@secondts/bark-react-native"]
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
24
|
Warning: If you are using pnpm v10+, run `pnpm approve-builds` and select `@secondts/bark-react-native` to allow the postinstall script to download the prebuilt native binaries.
|
|
35
25
|
|
|
36
|
-
|
|
26
|
+
2. Run prebuild
|
|
37
27
|
|
|
38
28
|
```bash
|
|
39
29
|
npx expo prebuild
|
|
@@ -41,6 +31,8 @@ npx expo prebuild
|
|
|
41
31
|
|
|
42
32
|
Note: `bark-react-native` contains native code and requires a development build. It will not work with Expo Go.
|
|
43
33
|
|
|
34
|
+
No config plugin is needed. If your `app.json` or `app.config.js` still lists `@secondts/bark-react-native` under `plugins`, the entry does nothing and can be removed.
|
|
35
|
+
|
|
44
36
|
### Bare React Native
|
|
45
37
|
|
|
46
38
|
1. Install the package
|
|
@@ -62,7 +54,7 @@ npx expo install @secondts/bark-react-native@beta
|
|
|
62
54
|
|
|
63
55
|
```bash
|
|
64
56
|
# Or install a specific beta version
|
|
65
|
-
npx expo install @secondts/bark-react-native@0.26.
|
|
57
|
+
npx expo install @secondts/bark-react-native@0.26.1
|
|
66
58
|
```
|
|
67
59
|
|
|
68
60
|
For bare React Native projects, use:
|
package/android/CMakeLists.txt
CHANGED
package/android/build.gradle
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
buildscript {
|
|
4
4
|
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
|
5
|
-
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["
|
|
5
|
+
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["BarkReactNative_kotlinVersion"]
|
|
6
6
|
|
|
7
7
|
repositories {
|
|
8
8
|
google()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Consumer ProGuard rules for @secondts/bark-react-native.
|
|
2
|
+
#
|
|
3
|
+
# build.gradle lists this file in `consumerProguardFiles`, so it must exist:
|
|
4
|
+
# AGP 9 (Expo SDK 58+, where R8 is on for release builds) fails the release
|
|
5
|
+
# build when a declared consumer rules file is missing. ubrn only generates
|
|
6
|
+
# this file for JNA bindings, which this package does not use.
|
|
7
|
+
|
|
8
|
+
# The TurboModule is instantiated reflectively by React Native's module
|
|
9
|
+
# registry, and its `nativeInstallRustCrate` / `nativeCleanupRustCrate`
|
|
10
|
+
# methods are resolved from JNI by name (cpp-adapter.cpp).
|
|
11
|
+
-keep class com.barkreactnative.** { *; }
|
|
12
|
+
|
|
13
|
+
# JNI entry points are looked up by their exact symbol names.
|
|
14
|
+
-keepclasseswithmembernames class * {
|
|
15
|
+
native <methods>;
|
|
16
|
+
}
|
package/app.plugin.js
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
module
|
|
1
|
+
// No native configuration is needed: the module is autolinked, and the only
|
|
2
|
+
// setting the old plugin applied (`android.useAndroidX=true`) is already on in
|
|
3
|
+
// the Expo and React Native templates. Kept as a pass-through so app configs
|
|
4
|
+
// that still list "@secondts/bark-react-native" under `plugins` keep working.
|
|
5
|
+
module.exports = (config) => config;
|
|
@@ -56,10 +56,15 @@ class WalletNotifications {
|
|
|
56
56
|
const localHolder = this.wallet.notifications();
|
|
57
57
|
this.holder = localHolder;
|
|
58
58
|
(async () => {
|
|
59
|
+
// The loop stays live only while `holder` is still `localHolder`. An
|
|
60
|
+
// unsubscribe that lands while no native wait is pending (from inside a
|
|
61
|
+
// listener, or while an event is in flight) makes the cancel a no-op,
|
|
62
|
+
// so without this check the loop would keep running next to the loop of
|
|
63
|
+
// the next subscription and every event would be delivered twice.
|
|
59
64
|
try {
|
|
60
|
-
while (
|
|
65
|
+
while (this.holder === localHolder) {
|
|
61
66
|
const event = await localHolder.nextNotification();
|
|
62
|
-
if (event == null) break;
|
|
67
|
+
if (event == null || this.holder !== localHolder) break;
|
|
63
68
|
for (const listener of this.listeners) {
|
|
64
69
|
try {
|
|
65
70
|
listener(event);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WalletNotifications","holder","listeners","Set","constructor","wallet","subscribe","listener","add","size","startLoop","delete","cancelNextNotificationWait","localHolder","notifications","event","nextNotification","err","console","error","exports"],"sourceRoot":"../../src","sources":["WalletNotifications.ts"],"mappings":";;;;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,mBAAmB,CAAC;EACvBC,MAAM,GAAuC,IAAI;EACxCC,SAAS,GAAG,IAAIC,GAAG,CAAsC,CAAC;EAE3EC,WAAWA,CAAkBC,MAAuB,EAAE;IAAA,KAAzBA,MAAuB,GAAvBA,MAAuB;EAAG;EAEvDC,SAASA,CAACC,QAA6C,EAAe;IACpE,IAAI,CAACL,SAAS,CAACM,GAAG,CAACD,QAAQ,CAAC;IAE5B,IAAI,IAAI,CAACL,SAAS,CAACO,IAAI,KAAK,CAAC,EAAE;MAC7B,IAAI,CAACC,SAAS,CAAC,CAAC;IAClB;IAEA,OAAO,MAAM;MACX,IAAI,CAACR,SAAS,CAACS,MAAM,CAACJ,QAAQ,CAAC;MAC/B,IAAI,IAAI,CAACL,SAAS,CAACO,IAAI,KAAK,CAAC,EAAE;QAC7B,IAAI,CAACR,MAAM,EAAEW,0BAA0B,CAAC,CAAC;QACzC,IAAI,CAACX,MAAM,GAAG,IAAI;MACpB;IACF,CAAC;EACH;EAEQS,SAASA,CAAA,EAAS;IACxB,MAAMG,WAAW,GAAG,IAAI,CAACR,MAAM,CAACS,aAAa,CAAC,CAAC;IAC/C,IAAI,CAACb,MAAM,GAAGY,WAAW;IAEzB,CAAC,YAAY;MACX,IAAI;QACF,OAAO,IAAI,EAAE;
|
|
1
|
+
{"version":3,"names":["WalletNotifications","holder","listeners","Set","constructor","wallet","subscribe","listener","add","size","startLoop","delete","cancelNextNotificationWait","localHolder","notifications","event","nextNotification","err","console","error","exports"],"sourceRoot":"../../src","sources":["WalletNotifications.ts"],"mappings":";;;;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,mBAAmB,CAAC;EACvBC,MAAM,GAAuC,IAAI;EACxCC,SAAS,GAAG,IAAIC,GAAG,CAAsC,CAAC;EAE3EC,WAAWA,CAAkBC,MAAuB,EAAE;IAAA,KAAzBA,MAAuB,GAAvBA,MAAuB;EAAG;EAEvDC,SAASA,CAACC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CAAC;EACN;AACF;AAACmB,OAAA,CAAApB,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getter","globalThis","NativeBark","_default","exports","default","isRustFutureContinuationCallbackTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/bark-ffi.ts"],"mappings":";;;;;;AAAA;AACA;;AAEA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["getter","globalThis","NativeBark","_default","exports","default","isRustFutureContinuationCallbackTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/bark-ffi.ts"],"mappings":";;;;;;AAAA;AACA;;AAEA;AACA;AACA;;AAwYA,MAAMA,MAAmC,GAAGA,CAAA,KAAOC,UAAU,CAASC,UAAU;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAClEL,MAAM,EAErB;AA0CA;AACA;AACA;AACA;AACA,MAAMM,8CAGL,GAAG,IAAI","ignoreList":[]}
|