Skip to content

Commit 5a21967

Browse files
authored
Merge pull request #41 from taskrabbit/rm/rn0.62-update-podspec
Updates to support Cocoapods for RN 0.62
2 parents 1931f05 + d1eda87 commit 5a21967

File tree

6 files changed

+98
-19
lines changed

6 files changed

+98
-19
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) TaskRabbit, Inc. and its affiliates.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,38 @@ Simple module that allows displaying Zopim Chat from Zendesk for React Native.
44

55
## VERSIONS
66

7-
For RN version higher than 0.30 use version >= 0.1.x
7+
For RN version higher than 0.59 use version >= 0.3.0
88

9-
For RN version lower than 0.30 use version 0.0.2.
9+
For RN version lower than 0.59 use version <= 0.2.2
1010

11-
Since version 0.2.0 `department` is set to `ZDCPreChatDataRequiredEditable`.
11+
## Known Issues
1212

13-
## Known issues
14-
15-
I could not find how to make the import for iOS work properly since I'm using Cocoapods for Zendesk, if you have a suggestion that would be great.
16-
17-
## Getting started
13+
## Getting Started
1814

1915
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).
2016

2117
### Manual install
18+
19+
1. With npm:
20+
21+
`npm install react-native-zendesk-chat --save`
22+
23+
or with yarn:
24+
25+
`yarn add react-native-zendesk-chat`
26+
2227
#### iOS
23-
1. `npm install react-native-zendesk-chat --save`
24-
2. 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.
28+
29+
2. Add a reference to your Podfile:
30+
31+
`pod 'RNZendeskChat', :git => 'https://github.com/robertmurray/react-native-zendesk-chat.git'`
32+
33+
then run pod install: `(cd ios; pod install)`
34+
35+
or manually:
36+
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.
38+
2539
3. Configure `ZDCChat` in `AppDelegate.m`:
2640

2741
```
@@ -31,10 +45,11 @@ Follow the instructions to install the SDK for [iOS](https://developer.zendesk.c
3145
```
3246

3347
#### Android
34-
1. `npm install react-native-zendesk-chat --save`
48+
3549
2. Open up `android/app/main/java/[...]/MainApplication.java`
36-
- Add `import com.taskrabbit.zendesk.*;` to the imports at the top of the file
37-
- Add `new RNZendeskChatPackage(this)` to the list returned by the `getPackages()` method
50+
51+
- Add `import com.taskrabbit.zendesk.*;` to the imports at the top of the file
52+
- Add `new RNZendeskChatPackage(this)` to the list returned by the `getPackages()` method
3853

3954
3. Append the following lines to `android/settings.gradle`:
4055

@@ -57,9 +72,13 @@ ZopimChat.init("YOUR_ZENDESK_ACCOUNT_KEY").build();
5772

5873
## Usage
5974

60-
In your code add `import ZendeskChat from 'react-native-zendesk-chat';`.
75+
In your code add:
6176

6277
```
78+
import ZendeskChat from 'react-native-zendesk-chat
79+
80+
...
81+
6382
ZendeskChat.startChat({
6483
name: user.full_name,
6584
email: user.email,
@@ -71,5 +90,9 @@ ZendeskChat.startChat({
7190

7291
## TODO
7392

74-
* Allow setting form configuration from JS
75-
* Add examples
93+
- Allow setting form configuration from JS
94+
- Add examples
95+
96+
## License
97+
98+
React Native is MIT licensed, as found in the [LICENSE](https://github.com/taskrabbit/react-native-zendesk-chat/LICENSE) file.

RNZendeskChat.podspec

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
require 'json'
2+
3+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4+
5+
Pod::Spec.new do |s|
6+
s.name = "RNZendeskChat"
7+
s.version = package['version']
8+
s.summary = package['description']
9+
s.license = package['license']
10+
s.authors = package['author']
11+
s.homepage = package['homepage']
12+
s.platform = :ios, "10"
13+
s.source = { :git => "https://github.com/taskrabbit/react-native-zendesk-chat.git", :tag => "v#{s.version}" }
14+
s.source_files = "ios/*.{h,m}"
15+
s.static_framework = true
16+
17+
s.framework = 'Foundation'
18+
s.framework = 'UIKit'
19+
20+
s.dependency 'React'
21+
s.dependency 'ZDCChat'
22+
end

ios/RNZendeskChatModule.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ @implementation RNZendeskChatModule
2424
if (options[@"phone"]) {
2525
visitor.phone = options[@"phone"];
2626
}
27-
visitor.shouldPersist = options[@"shouldPersist"] || NO;
27+
visitor.shouldPersist = [options[@"shouldPersist"] boolValue] || NO;
2828
}];
2929
}
3030

package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-zendesk-chat",
3-
"version": "0.2.2",
3+
"version": "0.3.0",
44
"description": "React Native Wrapper around Zopim Zendesk Chat",
55
"main": "index.js",
66
"repository": {
@@ -16,6 +16,15 @@
1616
"android",
1717
"react-component"
1818
],
19+
"homepage": "https://github.com/taskrabbit/react-native-zendesk-chat.git",
20+
"bugs": "https://github.com/taskrabbit/react-native-zendesk-chat/issues",
1921
"author": "jrichardlai",
20-
"license": "MIT"
22+
"contributors": [
23+
"Robert Murray <[email protected]>"
24+
],
25+
"license": "MIT",
26+
"peerDependencies": {
27+
"react": "^16.11.0",
28+
"react-native": "^0.60.0"
29+
}
2130
}

yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+
# yarn lockfile v1
3+
4+

0 commit comments

Comments
 (0)