@saltware/fidbek-react-native 0.1.1 → 0.1.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 +86 -14
- package/android/libs/fidbek-android.aar +0 -0
- package/android/src/main/java/com/fidbek/reactnative/FidbekBridge.kt +27 -1
- package/android/src/newarch/com/fidbek/reactnative/FidbekReactNativeModule.kt +1 -1
- package/ios/FidbekSDK.xcframework/Info.plist +5 -5
- package/ios/FidbekSDK.xcframework/ios-arm64/FidbekSDK.framework/FidbekSDK +0 -0
- package/ios/FidbekSDK.xcframework/ios-arm64_x86_64-simulator/FidbekSDK.framework/FidbekSDK +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
# @saltware/fidbek-react-native
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React Native TurboModule bridge for Fidbek mobile SDK.
|
|
4
4
|
|
|
5
|
-
## Architecture
|
|
5
|
+
## Architecture Policy
|
|
6
6
|
|
|
7
7
|
- Supported: React Native New Architecture (`newArchEnabled=true`)
|
|
8
|
+
- Supported bridge type: TurboModule / JSI
|
|
8
9
|
- Not supported: Old Architecture (legacy bridge)
|
|
9
10
|
|
|
10
|
-
##
|
|
11
|
-
|
|
12
|
-
1. Install package:
|
|
11
|
+
## Install
|
|
13
12
|
|
|
14
13
|
```bash
|
|
15
14
|
npm install @saltware/fidbek-react-native
|
|
@@ -17,36 +16,56 @@ npm install @saltware/fidbek-react-native
|
|
|
17
16
|
yarn add @saltware/fidbek-react-native
|
|
18
17
|
```
|
|
19
18
|
|
|
19
|
+
## React Native CLI Setup
|
|
20
|
+
|
|
21
|
+
1. Ensure New Architecture is enabled.
|
|
22
|
+
|
|
23
|
+
In `android/gradle.properties`:
|
|
24
|
+
|
|
25
|
+
```properties
|
|
26
|
+
newArchEnabled=true
|
|
27
|
+
```
|
|
28
|
+
|
|
20
29
|
2. Install iOS pods:
|
|
21
30
|
|
|
22
31
|
```bash
|
|
23
|
-
cd ios
|
|
32
|
+
cd ios
|
|
33
|
+
pod install
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
3. Run app:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx react-native run-ios
|
|
40
|
+
npx react-native run-android
|
|
24
41
|
```
|
|
25
42
|
|
|
26
|
-
|
|
43
|
+
Notes:
|
|
27
44
|
|
|
28
|
-
|
|
45
|
+
- Android and iOS use autolinking
|
|
46
|
+
- No manual package registration needed
|
|
47
|
+
- No custom Metro config required
|
|
48
|
+
|
|
49
|
+
## Expo Setup (Development Build)
|
|
29
50
|
|
|
30
51
|
1. Install package:
|
|
31
52
|
|
|
32
53
|
```bash
|
|
33
54
|
npm install @saltware/fidbek-react-native
|
|
34
|
-
# or
|
|
35
|
-
yarn add @saltware/fidbek-react-native
|
|
36
55
|
```
|
|
37
56
|
|
|
38
|
-
2.
|
|
57
|
+
2. In `app.json`, enable New Architecture. Plugin is optional.
|
|
39
58
|
|
|
40
59
|
```json
|
|
41
60
|
{
|
|
42
61
|
"expo": {
|
|
62
|
+
"newArchEnabled": true,
|
|
43
63
|
"plugins": ["@saltware/fidbek-react-native"]
|
|
44
64
|
}
|
|
45
65
|
}
|
|
46
66
|
```
|
|
47
67
|
|
|
48
|
-
3.
|
|
49
|
-
|
|
68
|
+
3. Build native projects:
|
|
50
69
|
|
|
51
70
|
```bash
|
|
52
71
|
npx expo prebuild
|
|
@@ -54,4 +73,57 @@ npx expo run:ios
|
|
|
54
73
|
npx expo run:android
|
|
55
74
|
```
|
|
56
75
|
|
|
57
|
-
|
|
76
|
+
Notes:
|
|
77
|
+
|
|
78
|
+
- Expo Go is not supported (native binaries required)
|
|
79
|
+
- Plugin is currently a no-op; kept optional for forward compatibility
|
|
80
|
+
|
|
81
|
+
## Usage
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
import Fidbek from '@saltware/fidbek-react-native';
|
|
85
|
+
|
|
86
|
+
await Fidbek.configure({
|
|
87
|
+
token: 'YOUR_PUBLIC_TOKEN',
|
|
88
|
+
shakeToOpenEnabled: true,
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
await Fidbek.open();
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## API
|
|
95
|
+
|
|
96
|
+
- `configure({ token: string, shakeToOpenEnabled?: boolean }): Promise<void>`
|
|
97
|
+
- `open(): Promise<void>`
|
|
98
|
+
- `shutdown(): Promise<void>`
|
|
99
|
+
|
|
100
|
+
## Troubleshooting
|
|
101
|
+
|
|
102
|
+
### `Unable to resolve "@saltware/fidbek-react-native"`
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
npm install
|
|
106
|
+
npx react-native start --reset-cache
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Android crash: `NoClassDefFoundError androidx.viewbinding.ViewBinding`
|
|
110
|
+
|
|
111
|
+
Use `@saltware/fidbek-react-native@0.1.3+` and clean build:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
cd android
|
|
115
|
+
./gradlew clean
|
|
116
|
+
cd ..
|
|
117
|
+
npx react-native run-android
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Runtime: `Tried to show an alert while not attached to an Activity`
|
|
121
|
+
|
|
122
|
+
Call `open()` after app is foreground/resumed and after initial render cycle.
|
|
123
|
+
|
|
124
|
+
## Release Notes
|
|
125
|
+
|
|
126
|
+
### 0.1.3
|
|
127
|
+
|
|
128
|
+
- Refreshed bundled native artifacts (Android AAR + iOS XCFramework).
|
|
129
|
+
- Restored automatic screenshot capture in native feedback open flow.
|
|
Binary file
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package com.fidbek.reactnative
|
|
2
2
|
|
|
3
|
+
import android.app.Activity
|
|
3
4
|
import android.app.Application
|
|
4
5
|
import com.facebook.react.bridge.Promise
|
|
5
6
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
@@ -24,10 +25,18 @@ internal object FidbekBridge {
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
Fidbek.initialize(application, token, shakeToOpenEnabled)
|
|
28
|
+
primeSdkActivityTracker(reactContext.currentActivity)
|
|
27
29
|
promise.resolve(null)
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
fun open(promise: Promise) {
|
|
32
|
+
fun open(reactContext: ReactApplicationContext, promise: Promise) {
|
|
33
|
+
val currentActivity = reactContext.currentActivity
|
|
34
|
+
if (currentActivity == null) {
|
|
35
|
+
promise.reject("ERR_NO_CURRENT_ACTIVITY", "Current activity is unavailable")
|
|
36
|
+
return
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
primeSdkActivityTracker(currentActivity)
|
|
31
40
|
Fidbek.open()
|
|
32
41
|
promise.resolve(null)
|
|
33
42
|
}
|
|
@@ -36,4 +45,21 @@ internal object FidbekBridge {
|
|
|
36
45
|
Fidbek.shutdown()
|
|
37
46
|
promise.resolve(null)
|
|
38
47
|
}
|
|
48
|
+
|
|
49
|
+
private fun primeSdkActivityTracker(activity: Activity?) {
|
|
50
|
+
if (activity == null) {
|
|
51
|
+
return
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
val trackerField = Fidbek::class.java.getDeclaredField("activityTracker")
|
|
56
|
+
trackerField.isAccessible = true
|
|
57
|
+
val tracker = trackerField.get(null) ?: return
|
|
58
|
+
|
|
59
|
+
val onResumed = tracker.javaClass.getMethod("onActivityResumed", Activity::class.java)
|
|
60
|
+
onResumed.invoke(tracker, activity)
|
|
61
|
+
} catch (_: Throwable) {
|
|
62
|
+
// Best-effort priming only.
|
|
63
|
+
}
|
|
64
|
+
}
|
|
39
65
|
}
|
|
@@ -8,32 +8,32 @@
|
|
|
8
8
|
<key>BinaryPath</key>
|
|
9
9
|
<string>FidbekSDK.framework/FidbekSDK</string>
|
|
10
10
|
<key>LibraryIdentifier</key>
|
|
11
|
-
<string>ios-
|
|
11
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
12
12
|
<key>LibraryPath</key>
|
|
13
13
|
<string>FidbekSDK.framework</string>
|
|
14
14
|
<key>SupportedArchitectures</key>
|
|
15
15
|
<array>
|
|
16
16
|
<string>arm64</string>
|
|
17
|
+
<string>x86_64</string>
|
|
17
18
|
</array>
|
|
18
19
|
<key>SupportedPlatform</key>
|
|
19
20
|
<string>ios</string>
|
|
21
|
+
<key>SupportedPlatformVariant</key>
|
|
22
|
+
<string>simulator</string>
|
|
20
23
|
</dict>
|
|
21
24
|
<dict>
|
|
22
25
|
<key>BinaryPath</key>
|
|
23
26
|
<string>FidbekSDK.framework/FidbekSDK</string>
|
|
24
27
|
<key>LibraryIdentifier</key>
|
|
25
|
-
<string>ios-
|
|
28
|
+
<string>ios-arm64</string>
|
|
26
29
|
<key>LibraryPath</key>
|
|
27
30
|
<string>FidbekSDK.framework</string>
|
|
28
31
|
<key>SupportedArchitectures</key>
|
|
29
32
|
<array>
|
|
30
33
|
<string>arm64</string>
|
|
31
|
-
<string>x86_64</string>
|
|
32
34
|
</array>
|
|
33
35
|
<key>SupportedPlatform</key>
|
|
34
36
|
<string>ios</string>
|
|
35
|
-
<key>SupportedPlatformVariant</key>
|
|
36
|
-
<string>simulator</string>
|
|
37
37
|
</dict>
|
|
38
38
|
</array>
|
|
39
39
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED