Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
react-native-tapresearch
Advanced tools
TapResearch Monetized Survey React Native SDK
package.json
init()
function inside Tapsdk.swift
native iOS bridge filegit tag -a v1.0.0 -m "v1.0.0"
git push origin v1.0.0
yarn prepack
yarn release
npm install react-native-tapresearch
yarn add react-native-tapresearch
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}
/>
)
// ...
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library
FAQs
TapResearch React Native SDK
The npm package react-native-tapresearch receives a total of 207 weekly downloads. As such, react-native-tapresearch popularity was classified as not popular.
We found that react-native-tapresearch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.