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

react-native-tapresearch

v3.2.4

Published

TapResearch Monetized Surveys React Native SDK

Downloads

704

Readme

react-native-tapresearch

TapResearch Monetized Survey React Native SDK

Releasing the package

  1. Update the version in package.json
  2. Run git tag -a v1.0.0 -m "v1.0.0"
  3. Run git push origin v1.0.0
  4. Run yarn prepack
  5. Run yarn release

Installation

NPM

npm install react-native-tapresearch

Yarn

yarn add react-native-tapresearch

Usage

Full docs are located here https://supply-docs.tapresearch.com/docs/3.x/intro

import {
  PlacementCustomParamsProps,
  TapSdkAdapter,
  TapSdkUI,
  TapUserAttributes,
} from 'react-native-tapresearch';

// create user attributes you'd like to send and filter on
const userAttributes: TapUserAttributes = {
  boolean: true,
  integer: 1,
  double: 1.1,
  string: 'string',
  userIdentifier: userIdentifier,
};
// ...
// create a list of placements you want to use
const placements: string[] = [
  'default-placement-a',
  'interstitial-placement-a',
  'banner-placement-a',
  'capped-and-paced-interstitial-a',
  'floating-interstitial-placement-a',
];
// ...
// Set a unique identifier for the user
TapSdkAdapter.setUniqueUserIdentifier(userIdentifier);
// ...
// Send user identifiers
TapSdkAdapter.sendUserAttributes(userAttributes, "true"|"false");

// Do some things when the sdk is ready
function onTapResearchSdkReady() {
  console.log(
    'TapResearch SDK is ready, you can update the user attributes now',
  );
  userAttributes['testInt'] = 1;
  const now = new Date();
  const oneMonthAgo = new Date(now);
  oneMonthAgo.setMonth(now.getMonth() - 1);
  userAttributes['A Month Ago 8601'] = oneMonthAgo.toISOString();
  userAttributes['isQA'] = "true";
  sendUserAttributes();
}
// Called when content is dismissed
function contentDismissed(contentMessage: any) {
  console.log('Content dismissed', contentMessage);
}
// Called when content is shown
function contentShown(contentMessage: any) {
  console.log('Content shown', contentMessage);
}
// Called when an error occurs
function onError(errorMessage: any) {
  console.error(errorMessage.message);
}
// Called when rewards are received
function doRewards(rewards: Array<any>) {
  console.log('Received some rewards', rewards);
  console.log('Received some rewards type', rewards.constructor.name);
  let totalReward = 0;
  rewards.forEach((reward: any) => {
    totalReward += reward.rewardAmount;
  });
  Toast.show({
    type: 'success',
    text1: 'Reward',
    text2: totalReward.toString(),
  });
}

// ...
// Load up the TapSDK
return (
  <TapSdkUI
    onDidReceiveRewards={doRewards}
    onDidReceiveQQResponse={doQQResponse}
    onContentDismissed={contentDismissed}
    onContentShown={contentShown}
    onDidReceiveError={onError}
    onTapResearchSdkReady={onTapResearchSdkReady}
  />
)
// ...

Contributing

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

License

MIT


Made with create-react-native-library