react-native-newinstance-chat 0.1.0 → 0.1.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.
- package/NewinstanceChat.podspec +2 -1
- package/README.md +14 -0
- package/android/build.gradle +3 -5
- package/ios/NewinstanceChat.mm +8 -1
- package/package.json +1 -1
package/NewinstanceChat.podspec
CHANGED
|
@@ -15,9 +15,10 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
|
|
16
16
|
s.source_files = "ios/**/*.{h,m,mm,swift,cpp}"
|
|
17
17
|
s.private_header_files = "ios/**/*.h"
|
|
18
|
+
s.pod_target_xcconfig = { "DEFINES_MODULE" => "YES" }
|
|
18
19
|
|
|
19
20
|
# Native chat SDK we wrap, published on CocoaPods Trunk.
|
|
20
|
-
s.dependency "LiveAndAiChat", "~> 0.1"
|
|
21
|
+
s.dependency "LiveAndAiChat", "~> 0.1.0"
|
|
21
22
|
|
|
22
23
|
install_modules_dependencies(s)
|
|
23
24
|
end
|
package/README.md
CHANGED
|
@@ -32,6 +32,16 @@ cd ios && pod install
|
|
|
32
32
|
Autolink pulls the `NewinstanceChat` podspec, which transitively depends
|
|
33
33
|
on `LiveAndAiChat` (the native SDK pod, published on CocoaPods Trunk).
|
|
34
34
|
|
|
35
|
+
Both default static-library Podfiles and `use_frameworks!` (any linkage)
|
|
36
|
+
are supported. If you see `'NewinstanceChat-Swift.h' file not found` you
|
|
37
|
+
are on 0.1.0, which only resolved the generated Swift header in
|
|
38
|
+
static-library builds. Upgrade to 0.1.1 or later, then reinstall pods:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
npm install react-native-newinstance-chat@latest
|
|
42
|
+
cd ios && pod install
|
|
43
|
+
```
|
|
44
|
+
|
|
35
45
|
### Android
|
|
36
46
|
|
|
37
47
|
Autolink registers `NewinstanceChatPackage`. The underlying
|
|
@@ -54,6 +64,10 @@ sdk.setUser({
|
|
|
54
64
|
|
|
55
65
|
await sdk.initialize();
|
|
56
66
|
|
|
67
|
+
// `sdk.ready` is a Promise that resolves once the native module is configured -
|
|
68
|
+
// await it anywhere you need to know setup completed.
|
|
69
|
+
await sdk.ready;
|
|
70
|
+
|
|
57
71
|
// Later, in response to a host button tap:
|
|
58
72
|
sdk.openChat();
|
|
59
73
|
```
|
package/android/build.gradle
CHANGED
|
@@ -65,15 +65,13 @@ android {
|
|
|
65
65
|
repositories {
|
|
66
66
|
google()
|
|
67
67
|
mavenCentral()
|
|
68
|
-
// Dev fallback
|
|
69
|
-
//
|
|
70
|
-
// in liveAndAiChat-android/ but the Maven Central publish hasn't
|
|
71
|
-
// landed yet. Remove this once the SDK is live on Maven Central.
|
|
68
|
+
// Dev fallback for local native SDK work after publishing
|
|
69
|
+
// liveAndAiChat-android with `./gradlew :sdk:publishToMavenLocal`.
|
|
72
70
|
mavenLocal()
|
|
73
71
|
}
|
|
74
72
|
|
|
75
73
|
dependencies {
|
|
76
74
|
implementation "com.facebook.react:react-android"
|
|
77
75
|
// Native chat SDK the bridge wraps. Published under cloud.newinstance.
|
|
78
|
-
implementation "cloud.newinstance:liveandaichat:0.1.
|
|
76
|
+
implementation "cloud.newinstance:liveandaichat:0.1.1"
|
|
79
77
|
}
|
package/ios/NewinstanceChat.mm
CHANGED
|
@@ -4,8 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
// Auto-generated Swift bridging header for this pod (created at build
|
|
6
6
|
// time by Xcode/CocoaPods when the pod mixes Obj-C and Swift). The pod
|
|
7
|
-
// name is `NewinstanceChat`, hence the header name.
|
|
7
|
+
// name is `NewinstanceChat`, hence the header name. Framework builds
|
|
8
|
+
// (`use_frameworks!`) place it inside the framework, reachable only via
|
|
9
|
+
// the angle-bracket path; static-library builds emit it to derived
|
|
10
|
+
// sources, reachable only via the quote form, so probe for both.
|
|
11
|
+
#if __has_include(<NewinstanceChat/NewinstanceChat-Swift.h>)
|
|
12
|
+
#import <NewinstanceChat/NewinstanceChat-Swift.h>
|
|
13
|
+
#else
|
|
8
14
|
#import "NewinstanceChat-Swift.h"
|
|
15
|
+
#endif
|
|
9
16
|
|
|
10
17
|
// Declare conformance to NewinstanceChatEmitter (defined in
|
|
11
18
|
// NewinstanceChatImpl.swift) so the Swift impl can hold a typed weak
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-newinstance-chat",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "New instance LiveAndAiChat React Native SDK — AI + live-agent chat, drop-in native chat screen for iOS and Android.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|