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

cordova-plugin-tapjoy

v1.0.1

Published

Tapjoy ads for Apache Cordova

Downloads

9

Readme

cordova-plugin-tapjoy

Tapjoy ads for Apache Cordova

WARNING: This plugin available only for iOS.

Install plugin

$ cordova plugin add cordova-plugin-tapjoy

The plugin.xml doesn't have ablity to put embedded frameworks to your project automaticly (or I didn't find the solution), so find Tapjoy.embeddedFramework in sources (src/ios) and drag & drop it to the directory into Xcode under Frameworks.

IMPORTANT: The Tapjoy.embeddedframework folder should be added as a group (yellow folder) and not as a reference (blue folder).

Methods

Tapjoy.setup(success_cb, error_cb, debugMode, userID, appKey)

Initial method wich connect to Tapjoy.
(boolean) debugMode - if set to true you could see debug output from Tapjoy SDK.
(string) userID - the unique userID need if you use self managed currency otherwise it should be null.
(string) appKey - the appKey of your app in Tapjoy Dashboard.

Tapjoy.setUserID(userID)

Additional method to set unique userID.
You can use this method to set or edit userID whenever after tapjoy already connected. (string) userID

Tapjoy.createPlacement(success_cb, error_cb, name)

IMPORTANT: Create for every type of ad new placement in your Tapjoy Dashboard.

In Tapjoy you can have many placements and types like Rewarded Videos, Skippable Videos, Offerwall etc.
You need to initialize every placements you have, using this method.
(string) - name of your placement

Tapjoy.requestContent(success_cb, error_cb, name)

When success callback was emitted you can show an ad.
(string) - name of your placement

Tapjoy.showContent(success_cb, error_cb, name)

Show an ad.
(string) - name of your placement

Example

In this sample I use async.js but you can use what you want.

import async from 'async';

let appKey = 'TapjoyAppKey';
let userID = "Unique ID can be null";
let debugMode = true;
let tapjoyPlacements = ['MyOfferwall', 'MyRewardedVideo', 'MySkippableVideo']

Tapjoy.setup(() => {
  async.each(tapjoyPlacements, (placement, callback) => {
    Tapjoy.createPlacement(() => {
      callback();
    }, (error) => {
      callback(error)
    }, placement);
  }, (error) => {
    if (error) {
      console.log(error);
    } else {     
      Tapjoy.requestContent(() => {
        Tapjoy.showContent(() => {
          console.log('User watched an ad');
        }, (error) => {
          console.log(error);
        }, tapjoyPlacements[0]);
      }, (error) => {
        console.log(error);        
      }, tapjoyPlacements[0])
    }
  })  
}, (error) => {
  console.log(error);
}, debugMode, userID, appKey)

paypal