1.0.4 • Published 3 years ago

react-native-qwary-latest v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

react-native-qwary

React Navtive Library for survey which enables you to integrate feedback into Android app using few lines of code. ​

Installation

​ ​

Getting started

$ npm install react-native-qwary-latest --save

Mostly automatic installation

$ react-native link react-native-qwary-latest

Manual installation

Android Usage

  <View style={styles.container}>
      <TouchableOpacity
        onPress={() =>
          Survey.runSurvey(
            {
              domain: 'https://survey.qwary.com/form/',
              token: '3Y6A066rNaDrV17TDvQBN6VHVe0P5jrXTClr9qVwer0=',
              loader: true,  /* For loading bar visibility */
              modal: false,  /* For full and half view */
              showNow: true, /* Invoke survey now or else schedule */
              startAfter: '60000',  /* Time interval for schedule (60000 for to schedule after 1 minute) */
              params: [  /* Add desired params */
                { email: 'jondoe@acmeinc.com'},
                { planId: 'trial1'},
              ]
            },
            () => console.log('CallBack'),
          )
        }>
        <Text>useColorScheme(): {colorScheme}</Text>
      </TouchableOpacity>
    </View>

IOS Usage

​ ​Note: Use Xcode to avoid error

Download swift source code from here

  • Add the qwarysurvey/QWarySurvey/SDK in your project ProjectRoot/ios folder
  • Create the bridging header and add '#import "React/RCTBridgeModule.h'.
  • Open the IOS folder in XCode go to your project Build settings and find "Defines Modules" and change it to yes. ​ Alt textAlt text
  • Go Inside SDK/RCTBridgingObjC/RCTQwarySurveyModule.m and change #import 'qwary-Swift.h' to your projects name (e.x AppName.xcworkspace #import 'AppName-Swift.h) and its case-sensetive. ​

Usage

import {NativeModule} from 'react-native',
const Survey=NativeModule.Survey;
const runSurvey=Survey.runSurvey
//You can use this runSurvey()
// TODO: What to do with the module?
Survey;