All Projects → reime005 → react-native-tapjoy

reime005 / react-native-tapjoy

Licence: MIT License
This module provides react-native bindings for the Tapjoy SDK.

Programming Languages

java
68154 projects - #9 most used programming language
objective c
16641 projects - #2 most used programming language
javascript
184084 projects - #8 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to react-native-tapjoy

ionic4-phaser3-template
Ionic 4 and phaser 3 template
Stars: ✭ 19 (+18.75%)
Mutual labels:  mobile-app
Notre-Dame-v3
The 3rd generation of ÉTSMobile, the main gateway between the École de technologie supérieure and its students on mobile devices
Stars: ✭ 13 (-18.75%)
Mutual labels:  mobile-app
GalaxyBreak
Galaxy Break is a minimalistic endless video game for mobile published for Android platform.
Stars: ✭ 21 (+31.25%)
Mutual labels:  mobile-app
tests-ionic2-and-aurelia-framework7
Test TODO applications to compare ionic2 and Aurelia + Framework7
Stars: ✭ 14 (-12.5%)
Mutual labels:  mobile-app
fire-todo
📱 Android App - simple todo-list
Stars: ✭ 16 (+0%)
Mutual labels:  mobile-app
CouchDraw
A synchronized drawing app that utilizes Couchbase Sync Gateway and Xamarin to enable shared canvases.
Stars: ✭ 22 (+37.5%)
Mutual labels:  mobile-app
fmo-cpp-demo
Fast Moving Objects Detection (demo version)
Stars: ✭ 36 (+125%)
Mutual labels:  mobile-app
esteem
eSteem Mobile - Application for Android and iOS users, start earning cryptocurrency!
Stars: ✭ 88 (+450%)
Mutual labels:  mobile-app
pass-culture-app-native
Mobile and web application for pass Culture
Stars: ✭ 18 (+12.5%)
Mutual labels:  mobile-app
Glance
Another client for Reddit, but this time, it's not just a client. It's a different way of browsing photos, GIFs, memes and other things there!
Stars: ✭ 104 (+550%)
Mutual labels:  mobile-app
addIt
Simple addition game made with Flutter for Mobile and Web using BLOC pattern
Stars: ✭ 16 (+0%)
Mutual labels:  mobile-app
CryptoBuddy
Android app which displays cryptocurrency prices, charts and news!
Stars: ✭ 93 (+481.25%)
Mutual labels:  mobile-app
crop your image
A flutter plugin which provides Crop Widget for cropping images.
Stars: ✭ 74 (+362.5%)
Mutual labels:  mobile-app
MTJailed-Native
A terminal emulator with remote shell for non-jailbroken iOS devices
Stars: ✭ 24 (+50%)
Mutual labels:  mobile-app
flutter designs world
We at Appstree has implemented design concepts of different application using mock ups available out there at internet. These are open source projects and any once can use them. Say Hello to us at [email protected], if you want to hire our team is available to provide you top notch solutions.
Stars: ✭ 22 (+37.5%)
Mutual labels:  mobile-app
FD-Daily-Task
Create responsive dashboard Daily Task design using Flutter
Stars: ✭ 181 (+1031.25%)
Mutual labels:  mobile-app
mobile-deep-learning-classifier
Tutorial on building and deploying a Mobile Deep Learning Classifier for food
Stars: ✭ 64 (+300%)
Mutual labels:  mobile-app
computeiro
Computer science courses, books and exams in your pocket. Built with Flutter and Free! ❤️
Stars: ✭ 27 (+68.75%)
Mutual labels:  mobile-app
keplr-wallet
The most powerful wallet for the Cosmos ecosystem and the Interchain
Stars: ✭ 321 (+1906.25%)
Mutual labels:  mobile-app
crm-mobilesdk-library-for-ios
Microsoft Dynamics CRM Mobile SDK library for iOS app development.
Stars: ✭ 13 (-18.75%)
Mutual labels:  mobile-app

 

React Native Tapjoy

 

 

This module provides react-native bindings for the Tapjoy SDK.

 

npm GitHub Github Actions Status semantic-release

About Tapjoy

Tapjoy is a monetization and distribution services provider for mobile applications. Tapjoy’s goal is to maximize the value of every user for freemium mobile app publishers. Its Marketing Automation and Monetization Platform for mobile apps uses market leading data science, user segmentation and predictive analytics to drive deeper engagement and optimize revenue from every user.

About React Native

React Native lets you build mobile apps using only JavaScript. It uses the same design as React, letting you compose a rich mobile UI from declarative components. You don't build a “mobile web app”, an “HTML5 app”, or a “hybrid app”. You build a real mobile app that's indistinguishable from an app built using Objective-C or Java.

Install

Tested with react native version 0.60.0

npm install react-native-tapjoy --save

or:

yarn add react-native-tapjoy

Automatic Installation (react native version < 0.60.0)

react-native link
Manual Installation (react native version < 0.60.0)

iOS

  1. In the XCode's "Project navigator", right click on your project's Libraries folder ➜ Add Files to <...>
  2. Go to node_modulesreact-native-tapjoyios ➜ select RNTapjoy.xcodeproj
  3. Add libRNTapjoy.a to Build Phases -> Link Binary With Libraries
  4. Add the Tapjoy SDK to your XCode project as described on the Tapjoy website

Alertnatively, you may use the podspec file:

  ...
  pod 'RNTapjoy', :path => '../node_modules/react-native-tapjoy'
  ...

NOTE: You have to manually integrate the Push notifications feature as described on the Tapjoy website, because it requires access to the didFinishLaunchingWithOptions:` method in your application’s app delegate file.

Android

  1. Add the following lines to android/settings.gradle:

    include ':react-native-tapjoy'
    project(':react-native-tapjoy').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-tapjoy/android')
    
  2. Update the android build tools version to 3.4.1 in android/build.gradle:

    buildscript {
        ...
        dependencies {
            classpath 'com.android.tools.build:gradle:3.4.1'
        }
        ...
    }
    ...
  3. Update the gradle version to 5.4.1 in android/gradle/wrapper/gradle-wrapper.properties:

    ...
    distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
    
  4. Add the compile line to the dependencies in android/app/build.gradle:

    dependencies {
        compile project(':react-native-tapjoy')
    }
  5. Add the import and link the package in MainApplication.java:

    import com.mariusreimer.tapjoy.TapjoyPackage; // <-- add this import
    
    public class MainApplication extends Application implements ReactApplication {
        @Override
        protected List<ReactPackage> getPackages() {
            return Arrays.<ReactPackage>asList(
                new MainReactPackage(),
                new TapjoyPackage() // <-- add this line
            );
        }
    }
  6. Add the Tapjoy SDK to your Android project as described on the Tapjoy website.

Windows

Usage

TypeScript definitions are included.

Configuration

const options = {
    sdkKeyIos: "12345",
    sdkKeyAndroid: "12345",
    gcmSenderIdAndroid: "12345",
    debug: true
};

Initialization (without React Hooks)

import { Tapjoy } from 'react-native-tapjoy';

const tapjoy = new Tapjoy(options);

try {
    const initialized = await tapjoy.initialise();
    // tapjoy is initialized
} catch (e) {
    // error on initialization
}

Initialization (with React Hooks)

import { useEffect } from 'react';
import { useTapjoy } from 'react-native-tapjoy';

const [
    {
        tapjoyEvents
    },
    {
        initialiseTapjoy,
        listenToEvent,
        addTapjoyPlacement,
        showTapjoyPlacement,
        requestTapjoyPlacementContent,
        isTapjoyConnected,
        tapjoyListenForEarnedCurrency,
        getTapjoyCurrencyBalance,
        setTapjoyUserId,
        spendTapjoyCurrency,
    },
] = useTapjoy(tapjoyOptions);

useEffect(() => {
    try {
        const initialized = await initialiseTapjoy();
        // tapjoy is initialized
    } catch (e) {
        // error on initialization
    }
}, []);

List of Events

This is a list of events you may subscribe to:

Event Name Description
earnedCurrency Fired when currency was earned. The response contains the fields amount currencyName and currencyID (iOS only).
onPlacementDismiss Fired when a shown placement was dismissed. The response contains the field placementName.
onPlacementContentReady Fired when a placement's content is ready to be shown. The response contains the field placementName.
onPurchaseRequest Fired when a purchase is requested. The response contains the fields placementName, requestId, token and productId.
onRewardRequest Fired when a reward is requested. The response contains the fields placementName, requestId, token, itemId and quantity.

Listen for Events (without React Hooks)

tapjoy._on(eventName, () => {
    // event has fired
})

You may get a list of events from the constants: tapjoy.constants. It contains a events field.

Listen for Events (with React Hooks)

listenToEvent(eventName, () => {
    // event has fired
})

You may get a list of events from useTapjoy hook, named tapjoyEvents.

Add Placement (without React Hooks)

try {
    await tapjoy.addPlacement();
    // tapjoy placement was added
} catch (e) {
    // error
}

Add Placement (with React Hooks)

useEffect(() => {
    try {
        await addTapjoyPlacement('TestPlacement');
        // tapjoy placement was added
    } catch (e) {
        // error
    }
}, []);

Request Content (without React Hooks)

try {
    await tapjoy.requestContent('TestPlacement');
    // tapjoy placement content request was successful
} catch (e) {
    // request failed
}

Request Content (with React Hooks)

useEffect(() => {
    try {
        await requestTapjoyPlacementContent('TestPlacement');
        // tapjoy placement content request was successful
    } catch (e) {
        // request failed
    }
}, []);

Show Placement (without React Hooks)

try {
    await tapjoy.showPlacement('TestPlacement');
    // tapjoy placement content is showing
} catch (e) {
    // placement not added, or content not ready
}

Show Placement (with React Hooks)

useEffect(() => {
    try {
        await showTapjoyPlacement('TestPlacement');
        // tapjoy placement content is showing
    } catch (e) {
        // placement not added, or content not ready
    }
}, []);

Listen for Earned Currency (without React Hooks)

try {
    await tapjoy.listenForEarnedCurrency(({ amount, currencyName, currencyID }) => {
        // user earned currency
    });
} catch (e) {
    // error
}

Listen for Earned Currency (with React Hooks)

useEffect(() => {
    try {
        await tapjoyListenForEarnedCurrency(({ amount, currencyName, currencyID }) => {
            // user earned currency
        });
    } catch (e) {
    // error
    }
}, []);

Get Currency Balance (without React Hooks)

try {
    const { amount, currencyName } = await tapjoy.getCurrencyBalance();
} catch (e) {
    // error
}

Get Currency Balance (with React Hooks)

useEffect(() => {
    try {
        const { amount, currencyName } = await getTapjoyCurrencyBalance();
    } catch (e) {
        // error
    }
}, []);

Spend Currency (without React Hooks)

try {
    await tapjoy.spendCurrencyAction(42);
} catch (e) {
    // error
}

Spend Currency (with React Hooks)

useEffect(() => {
    try {
        await spendTapjoyCurrency(42);
    } catch (e) {
        // error
    }
}, []);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].