npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

surveysparrow-react-native-sdk

v0.1.10

Published

react native sdk for survey sparrow

Downloads

255

Readme

surveysparrow-react-native-sdk

SurveySparrow React Native SDK enables you to collect feedback from your mobile app. Embed the Classic, Chat & NPS surveys in your React Native application seamlessly with few lines of code.

Features

  1. Fully customizable pre-build Full Size View to take feedback whenever & wherever you want.
  2. Survey Component to integrate the feedback experience anywhere in your app.
  3. Schedule Surveys to take one-time or recurring feedbacks.

Installation

npm install surveysparrow-react-native-sdk

yarn add surveysparrow-react-native-sdk

IOS

Add SurveySparrow IOS sdk in pod file and run pod install

pod 'SurveySparrowSdk', :git => 'https://github.com/surveysparrow/surveysparrow-ios-sdk.git', :tag => '0.3.0'

ANDROID

Android doesn't require any changes and note the min sdk version should be 19

Usage

import {
  SurveySparrow,
  invokeSurveySparrow,
  onSurveyResponseListener,
  scheduleSurveySparrow,
  clearSurveySparrow,
} from 'surveysparrow-react-native-sdk';

// Embedded Survey
<SurveySparrow
  styles={styles.box}
  config={{
    domain: 'domain-name',
    token: 'survey-token',
    surveyType: 'classic',
    customParams: [
      { name: 'testname', value: 'custom value 10' },
      { name: 'testname2', value: 'custom value 2' },
    ],
  }}
  onSurveyComplete={(data) => {
    console.log('survey response from embed survey is', data);
  }}
/>
//  Full Survey
<Button
  title="Open Survey"
  onPress={() => {
    invokeSurveySparrow({
      domain: 'domain-name',
      token: 'survey-token',
      surveyType: 'classic',
    });
  }}
/>

// Schedule Survey
<Button
  title="Open Survey"
  onPress={() => {
    scheduleSurveySparrow({
      domain: 'domain-name',
      token: 'survey-token',
      surveyType: 'classic',
    });
  }}
/>

// clear schedule
<Button
  title="Open Survey"
  onPress={() => {
    clearSurveySparrow({
      domain: 'domain-name',
      token: 'survey-token',
      surveyType: 'classic',
    });
  }}
/>

// listining to survey complete event
React.useEffect(() => {
  const sub = onSurveyResponseListener.addListener(
    'onSurveyResponse',
    (data: any) => {
      console.log('survey response is', data);
    }
  );
  return () => sub.remove();
}, []);

Methods

1) invokeSurveySparrow()

This method will be used to invoke Survey from SurveySparrow

| parameter | Description | Default | Optional | | --- | --- | --- | -- | | domain | survey domain to load | value has to be provided | no | | token | survey token for the survey | value has to be provided | no | | surveyType | survey type for the survey | value has to be provided | no | | customParams | any custom params to be passed for the survey | [] | yes | | thankYouPageTimeLimit | how long the full view has to be shown before closing | 3000 (ms) | yes |

2) scheduleSurveySparrow()

This method will be used to schedule Survey from SurveySparrow

| parameter | Description | Default | Optional | | --- | --- | --- | -- | | domain | survey domain to load | value has to be provided | no | | token | survey token for the survey | value has to be provided | no | | surveyType | survey type for the survey | value has to be provided | no | | customParams | any custom params to be passed for the survey | [] | yes | | thankYouPageTimeLimit | how long the full view has to be shown before closing | 3000 (ms) | yes | | alertTitle | dialouge box alert title | 'Rate us' | yes | | alertMessage | dialouge box alert message | 'Share your feedback and let us know how we are doing' | yes | | alertPositiveText | dialouge box positive text | 'Rate Now' | yes | | alertNegativeText | dialouge box negative text | 'Later' | yes | | startAfter | after how long the initial schedule has to happen | 259200000 | yes | | repeatInterval | after how long the schedule should repeat | 432000000 | yes | | repeatSurvey | if the schedule should repeat | false | yes | | incrementalRepeat | if schedule has to be a incremental repeat | false | yes |

3) clearSurveySparrow()

This method will be used to clear the schedule that was previously set

| parameter | Description | Default | Optional | | --- | --- | --- | -- | | domain | survey domain to load | value has to be provided | no | | token | survey token for the survey | value has to be provided | no |

Event Listener

1) onSurveyResponseListener

| Listener name | Description | Optional | | --- | --- | --- | | onSurveyResponse | this event listener will be triggered after completing the survey | yes |

Component

1) SurveySparrow

This Component can be used to render a survey view

| prop | Description | Default | Optional | | --- | --- | --- | --- | | config | survey config such as domain,token,surveyType,customParams | config object has to be provided | no | | onSurveyComplete | callback function that will be called after survey complete | null | yes | | styles | component styles | null | yes |

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Please submit bugs/issues through GitHub issues we will try to fix it ASAP.