Git Product home page Git Product logo

android-gimbal-adapter's Introduction

Urban Airship Android Gimbal Adapter

The Urban Airship Gimbal Adapter is a drop-in class that allows users to integrate Gimbal Place events with Urban Airship.

Resources

Installation

To install it add the following dependency to your application's build.gradle file:

   implementation 'com.urbanairship.android:gimbal-adapter:7.3.0'

Set the Gimbal API key

Set the API key during Application#onCreate:

   Gimbal.setApiKey(this, "## PLACE YOUR API KEY HERE ##");

Alternatively you can have the adapter automatically persist and set the API key on Gimbal when the app starts:

   GimbalAdapter.shared(context).enableGimbalApiKeyManagement("## PLACE YOUR API KEY HERE ##");

To stop this behavior, you will need to disable it:

   GimbalAdapter.shared(context).disableGimbalApiKeyManagement();

Start the adapter

To start the adapter call:

   GimbalAdapter.shared(context).start();

Once the adapter is started, it will automatically resume its last state if the application is restarted in the background. You only need to call start once.

Android Marshmallow Permissions

Before the adapter is able to be started on Android M, it must request the location permission ACCESS_FINE_LOCATION. The adapter has convenience methods that you can use to request permissions while starting the adapter:

    GimbalAdapter.shared(context).startWithPermissionPrompt(new GimbalAdapter.PermissionResultCallback() {
        @Override
        public void onResult(boolean enabled) {
            if (enabled) {
                // permission granted and adapter started
            }
        }
    });

Alternatively you can follow requesting runtime permissions to manually request the proper permissions. Then once the permissions are granted, call start on the adapter.

Stopping the adapter

Adapter can be stopped at anytime by calling:

   GimbalAdapter.shared(context).stop();

android-gimbal-adapter's People

Contributors

rlepinski avatar ulrico972 avatar crow avatar brianbatchelder avatar gimbal-github-user avatar hcrowell avatar jyaganeh avatar javiersearight 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.