Wootric / react-native-wootric

React Native wrapper for Wootric
MIT License
2 stars 17 forks source link

Refactor package #6

Closed ambarwootric closed 5 years ago

ambarwootric commented 5 years ago

Changes:

- Add `wootric` scope for react-native-wootric package so called `@wootric/react-native-wootric`.
- Add circle ci config to auto publish react-native-wootric package to npm registry.
- Remove `WootricFragmentActivity` and update `wootric.init` method of `configureWithClientID` to accept any current activity.
- Remove `windows` dir as we are currently not supporting the widnows platform.
- Add `.editorconfig` file to android project for better code styling and format.
- Update `package.json` with Author, Github URL and package version to `1.0.1`. Also remove peerDependencies.
- Add LICENSE and update README.

Test:

  1. For Android a. Package setup:
    • Make sure you have nodejs installed.
    • In your current directory ru npm pack to create local npm package (i.e. .tgz file) for react-native-wootric. b. Create and setup react-native project:
    • Follow react-native getting started guide to setup the react-native tool and environment.
    • Create react native project using react-native init MyWootricProject
    • After so run npm install --save /path/to/your/tgz/npm/package (package which was generated above)
    • Then run npm link to link our react-native module with your project.
    • Finally in App.js file of your MyWootricProject add below code:
      
      import RNWootric from 'react-native-wootric';

RNWootric.configureWithClientID("client_id", "NPS-1234asdf"); RNWootric.setEndUserEmail("react_example@wootric.com"); RNWootric.setSurveyImmediately(true); RNWootric.setEndUserCreatedAt(1234567890); 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.showSurvey();


- Now run your project with `react-native run-android`
- You should see survey.

b. For iOS:
- I don't have setup, please try this out and help me know if this also works for iOS
ambarwootric commented 5 years ago

Thanks for cool review @diegoserranoa, I have tried to address your comments to best. And yeah sure let's do the testing tomorrow together 🤝