BlackBerry Phone 10 integration

Integrate your BlackBerry app with Localytics by following these instructions.

We recommend that customers developing apps with the WebWorks framework follow our HTML5 Integration Guide. BlackBerry additionally has an example WebWorks project instrumented with Localytics on their GitHub page.

For Cascades developers, the rest of this guide will show you how to instrument your BlackBerry Cascades app with Localytics.

This SDK provides Cascades support by introducing a simple to use Localytics QML interface, allowing you to easily instrument Localytics in your QML markup. Internally, this interface translates all incoming calls to JavaScript, and uses HTML5 and JavaScript to power our analytics engine. Customers needing to directly call tagging code from C++ may also opt to directly embed localytics.js in a ‘WebPage’ or ‘WebView’ object from their C++ code.

  1. In your Localytics Dashboard, create a new application and copy the application key.
  2. Download our Localytics.QML file and copy it to your project’s ‘assets’ folder.
  3. Download our JavaScript library and copy it to your project’s ‘assets’ folder.
  4. Take the application key you recorded and put it in the function at the top of your Localytics.QML file.
    function appKey() {
        return "YOUR APP KEY FROM STEP 2"
    }
  5. At the root of your app, add the following code as part of an attachedObject.
    attachedObjects: [
        Localytics {
            id: localytics
        }
    ]
  6. In the onCreationCompleted code of each QML file, open the Localytics session. If you have any custom dimensions you’d like to specify, be sure to include them in the first argument. Otherwise, you may just call open().
    onCreationCompleted: 
    {
        localytics.open(["Trial User"]);
    }
Congratulations! You're integrated. Check out the data in your Dashboard or get even more insights when you start tagging events. Don't forget to test your app. Run it in an emulator, or on a real device if possible.