You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+75-41Lines changed: 75 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,90 +4,124 @@ Simple module that allows displaying Zopim Chat from Zendesk for React Native.
4
4
5
5
## VERSIONS
6
6
7
-
For RN version higher than 0.59 use version >= 0.3.0
8
-
9
-
For RN version lower than 0.59 use version <= 0.2.2
7
+
- For RN version higher than 0.59 use version >= 0.3.0 (Zendesk Chat v1)
8
+
- For RN version lower than 0.59 use version <= 0.2.2 (Zendesk Chat v1)
10
9
11
10
## Known Issues
12
11
13
12
## Getting Started
14
13
15
14
Follow the instructions to install the SDK for [iOS](https://developer.zendesk.com/embeddables/docs/ios-chat-sdk/introduction) and [Android](https://developer.zendesk.com/embeddables/docs/android-chat-sdk/introduction).
16
15
17
-
### Manual install
16
+
With npm:
18
17
19
-
1. With npm:
18
+
`npm install react-native-zendesk-chat --save`
20
19
21
-
`npm install react-native-zendesk-chat --save`
20
+
or with yarn:
22
21
23
-
or with yarn:
22
+
`yarn add react-native-zendesk-chat`
24
23
25
-
`yarn add react-native-zendesk-chat`
24
+
### QuickStart & Usage
26
25
27
-
#### iOS
26
+
1. Setup Native Dependencies<br/> **iOS** If you're on react-native >= 0.60 and you have Cocoapods setup, then you just need to:
28
27
29
-
2. Add a reference to your Podfile:
28
+
```bash
29
+
$ yarn install # and see if there are any errors
30
+
$ (cd ios; pod install) # and see if there are any errors
31
+
# -- you may need to do `pod install --repo-update`
If you're on older react-native versions, please see the [Advanced Setup](#advanced-setup) section below
32
35
33
-
then run pod install: `(cd ios; pod install)`
36
+
**Android** If you're on react-native >= 0.60, Android should autodetect this dependency. You may need to call `react-native link`
34
37
35
-
or manually:
38
+
1. Call the JS Initializer:
36
39
37
-
In Xcode, drag and drop `node_modules/react-native-zendesk-chat/RNZendeskChat.m` and `node_modules/react-native-zendesk-chat/RNZendeskChat.h` into your project.
40
+
```javascript
41
+
importZendeskChatfrom"react-native-zendesk-chat";
38
42
39
-
3. Configure `ZDCChat` in `AppDelegate.m`:
43
+
// Once in your application:
44
+
ZendeskChat.init("YOUR_ZENDESK_ACCOUNT_KEY");
45
+
```
40
46
47
+
1. Show the Chat UI
48
+
49
+
```javascript
50
+
// On button press, when you want to show chat:
51
+
ZendeskChat.startChat({
52
+
name:user.full_name,
53
+
email:user.email,
54
+
phone:user.mobile_phone,
55
+
tags: ["tag1", "tag2"],
56
+
department:"Your department",
57
+
});
41
58
```
59
+
60
+
### Advanced Setup
61
+
62
+
Advanced users, or users running on older versions of react-native may want to initialize things in native.
63
+
64
+
#### iOS: Manually Setting up with Cocoapods
65
+
66
+
If you're on iOS < 0.60, you may need to manually install the cocoapod:
67
+
68
+
Add a reference to your Podfile:
69
+
70
+
```Podfile
71
+
pod 'RNZendeskChat', :git => 'https://github.com/taskrabbit/react-native-zendesk-chat.git'
72
+
```
73
+
74
+
then run pod install: `(cd ios; pod install)`
75
+
76
+
or manually:
77
+
78
+
In Xcode, drag and drop `node_modules/react-native-zendesk-chat/RNZendeskChat.m` and `node_modules/react-native-zendesk-chat/RNZendeskChat.h` into your project.
79
+
80
+
#### iOS: Configure `ZDCChat` in `AppDelegate.m`:
81
+
82
+
```objective-c
42
83
#import<ZDCChat/ZDCChat.h>
43
84
85
+
// ...
86
+
87
+
// Inside the appropriate appDidFinishLaunching method
0 commit comments