Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ android/.projectfilesbackup
node_modules/
npm-debug.log
yarn-error.log


# Xcode
#
Expand All @@ -43,7 +43,7 @@ DerivedData
*.ipa
*.xcuserstate
project.xcworkspace


# Android/IntelliJ
#
Expand Down
47 changes: 38 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,64 @@ As `@wootric/react-native-wootric` contains native codes so requires your projec

`$ react-native link`

### CocoaPods installation

Add the dependency to your `ios/Podfile` file:

```diff
platform :ios, '9.0'

target 'Podfile' do
# React installation from CocoaPods
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge',
'DevSupport',
'RCTText',
...
]
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

+ pod 'react-native-wootric', :path => '../node_modules/react-native-wootric'
end
```

Then, run `pod install`.

### Manual installation

[Linking Libraries](https://facebook.github.io/react-native/docs/linking-libraries-ios)

#### Windows

Support for Windows is currently not available.

## Usage

```javascript
import RNWootric from '@wootric/react-native-wootric';

RNWootric.configureWithClientID("client_id", "NPS-1234asdf");
RNWootric.setEndUserEmail("[email protected]");
RNWootric.configureWithClientID('client_id', 'NPS-1234asdf');
RNWootric.setEndUserEmail('[email protected]');
RNWootric.setSurveyImmediately(true);
RNWootric.setEndUserCreatedAt(1234567890);
RNWootric.setEndUserExternalId("external_id_1234");
RNWootric.setEndUserPhoneNumber("+17865551234");
RNWootric.setEndUserProperties({first_name: "React", last_name: "Native"});
RNWootric.setEndUserExternalId('external_id_1234');
RNWootric.setEndUserPhoneNumber('+17865551234');
RNWootric.setEndUserProperties({ first_name: 'React', last_name: 'Native' });
RNWootric.showOptOut(true);
RNWootric.setFirstSurveyAfter(5);
RNWootric.setCustomLanguage("ES");
RNWootric.setCustomProductName("Wootric React Native");
RNWootric.setCustomAudience("un amigo");
RNWootric.setCustomLanguage('ES');
RNWootric.setCustomProductName('Wootric React Native');
RNWootric.setCustomAudience('un amigo');
RNWootric.showSurvey();
```

## Possbile Errors and Solutions

1. If link fails then please delete node_modules dir and package-lock.json from your react native project and run `npm install` again.

2. If you get `Error:Execution failed for task ':app:processDebugResources'. > java.io.IOException: Could not delete folder “”` while running your react native for android (ex. react-native run-android) then please clean your android project (ex. gradlew clean) and run project again.

## License
[MIT License](https://choosealicense.com/licenses/mit/)

[MIT License](https://choosealicense.com/licenses/mit/)
24 changes: 0 additions & 24 deletions ios/RNWootric.podspec

This file was deleted.

22 changes: 22 additions & 0 deletions react-native-wootric.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require 'json'

package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
s.name = "react-native-wootric"
s.version = package['version']
s.summary = "React Native package for Wootric SDK"
s.homepage = "https://github.com/Wootric/react-native-wootric"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "author" => "[email protected]" }
s.platform = :ios, "8.0"
s.source = { :git => "https://github.com/Wootric/react-native-wootric.git" }
s.source_files = "ios/**/*.{h,m}"
s.requires_arc = true

s.dependency "React"
s.dependency "WootricSDK"

end