# React Native SDK

### Find Github Project Here: [QwarySurveyReactNative](https://github.com/manoj-qwary/QWarySurveyReactNative?utm_source=encharge\&utm_medium=email\&utm_campaign=Mobile+APP+SDK+Announcements\&utm_content=Introducing+Qwary%27s+new+mobile+app+SDK+for+in-app+feedback+%F0%9F%99%8C)

{% embed url="<https://vimeo.com/760582248?utm_campaign=Mobile+APP+SDK+Announcements&utm_content=Introducing+Qwary%27s+new+mobile+app+SDK+for+in-app+feedback+%F0%9F%99%8C&utm_medium=email&utm_source=encharge>" %}
React Native App SDK
{% endembed %}

### 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](https://gitlab.com/Shehryar3/qwarysurvey/)

* 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.​​

  <figure><img src="https://camo.githubusercontent.com/a0754ee59786417a6f778321412bba97acb7a4b9a0498948be2a1c2a3bde31aa/68747470733a2f2f692e696d6775722e636f6d2f734d4a5a7572432e706e67" alt=""><figcaption></figcaption></figure>

  <figure><img src="https://camo.githubusercontent.com/8509948864926a813eadab236ec2a8c66b6193c228f11e88e01d2ce9d6ad2253/68747470733a2f2f692e696d6775722e636f6d2f515546787767542e706e67" alt=""><figcaption></figcaption></figure>
* 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;
```

​
