Giter VIP home page Giter VIP logo

flurry-phonegap-plugin's Introduction

FlurryPlugin

Usage

cordova plugin add https://github.com/jfpsf/flurry-phonegap-plugin.git

Installation

Unfortunately the policy of Flurry doesn't allow to include the SDK in this repository, so:

  • you'll have to go to flurry.com
  • create an account
  • create iPhone AND Android applications to download the SDK files
  • Follow the installation steps that come with the SDK files, Flurry has great documentation. Basically;
    • Android:
      • Change the name of FlurryAgent-*.jar (or FlurryAnalytics-*.jar if using uptodate version) to FlurryAgent.jar
      • Copy FlurryAgent.jar into the 'plugins/com.phonegap.plugins.Flurry/src/android' folder
      • Plugin automatically adds references to Google Play Services and Android v4 support lib.
      • If you do not have android-support-vX.jar lib referenced in your project and get error messages, install it by following instructions at http://developer.android.com/tools/support-library/features.html#v4.
    • iOS:
      • Change the name of libFlurry_*.a to libFlurry.a
      • Copy libFlurry.a into the 'plugins/com.phonegap.plugins.Flurry/src/ios' folder.
      • Plugin automatically adds references to Security and SystemConfiguration frameworks.
      • Verify that libFlurry.a is in the Build Phases/Link Binary with Libraries and the Frameworks CFNetwork, Security and SystemConfiguration frameworks are added.

Integration

  1. Call the startSession() method, with your app key, after the device is ready (from js).
  2. Call the other Flurry plugin methods as appropriate (from js).
  3. In Android, call flurry.endSession when the app is paused and again call flurry.startSession when the app resumes, or it won't log the session.
  4. In iOS, setSessionReportsOnCloseEnabled and setSessionReportsOnPauseEnabled to log the session.

Example is

===================================================================================================================================================

		self.log('Flurry Analytics Init');
        if (window.plugins && window.plugins.flurry) {
            var ua = navigator.userAgent.toLowerCase();
            var isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile");
            if (isAndroid) {
                window.plugins.flurry.startSession('Your API Key', function () {
                    console.log('Flurry Success!');
                }, function () {
                    alert('Flurry Error!');
                });
            } else {
                window.plugins.flurry.startSession('Your API Key', function () {
                    console.log('Flurry Success!');
                    window.plugins.flurry.setSessionReportsOnCloseEnabled(true); // iOS only
                    window.plugins.flurry.setSessionReportsOnPauseEnabled(true); // iOS only
                }, function () {
                    alert('Flurry Error!');
                });
            }
        }

===================================================================================================================================================

Contributors

License

Apache 2.0

flurry-phonegap-plugin's People

Contributors

albertogasparin avatar amsul avatar andrewmichaelsmith avatar ddennis avatar ivankarpan avatar janpio avatar jfpsf avatar kdmny avatar koraybalci avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.