Git Product home page Git Product logo

android-sdk's Introduction

Android-sdk

The Mapp Mobile SDK is available for Mapp Engage mobile integrated customers. The SDKs enable you to integrate mobile push and in-app messaging into your campaign orchestration. SDK documentation is available at Mapp Cloud Mobile Integration.

Contents

We use mavenCentral for version 6.0.15+, instead of Jcenter Lattest verison on Jcenter is 6.0.12

Installation

Gradle

implementation 'com.mapp.sdk:mapp-android:6.0.18'

The SDK requires that you enable Java 8 in your builds.

compileOptions {
       sourceCompatibility JavaVersion.VERSION_1_8
       targetCompatibility JavaVersion.VERSION_1_8
}

Allow the network permission in your app manifest.

<uses-permission android:name="android.permission.INTERNET" />

The SDK supports min Android SDK (19).

Note that the SDK uses AndroidX, make sure to migrate your app to AndroidX Migration to avoid Manifest merger failure.

Initialization

Make sure your application build.gradle file include the applicationId attribute for android defaultConfig. Alternately, you can replace ${applicationId} with your application package (e.g com.yourapppackage.app). Include the following dependencies to your app's gradle.build dependencies section :

android {
    compileSdkVersion 31
    buildToolsVersion "33.0.0"
    defaultConfig {
        applicationId "com.yourapppackage.app" . //make sure you have this   
        minSdkVersion 19
        targetSdkVersion 31
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.mapp.sdk:mapp-android:6.0.18'
}

apply plugin: 'com.google.gms.google-services'

In the Application class of your android project, add following code

public class AppoxeeTestApp extends Application {

    private Appoxee.OnInitCompletedListener initFinishedListener = new Appoxee.OnInitCompletedListener() {
        @Override
        public void onInitCompleted(boolean successful, Exception failReason) {
            Log.i("APX", "init completed listener - Application class");
        }
    };
...
@Override
public void onCreate() {
    super.onCreate();
    ...
    AppoxeeOptions opt = new AppoxeeOptions();
    opt.sdkKey = SDK_KEY;
    opt.appID = APP_ID;
    opt.tenantID= TENANT_ID;
    opt.notificationMode = NotificationMode.BACKGROUND_AND_FOREGROUND; (optional)
    opt.server = Appoxee.Server.L3;
 
    Appoxee.engage(this, opt);
    Appoxee.instance().addInitListener(initFinishedListener);
    Appoxee.instance().setReceiver(MyPushBroadcastReceiver.class);
    //Necessary for applications with locked screen rotation. 
    Appoxee.setOrientation(this, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    //Registered users are opt-outed by default.
    Appoxee.instance().setPushEnabled(true);
    ...
}
  
...
}

pass your sdk key and google project id, sdk key is present in your CEP dashboard. Add the application in the Android manifest file.

NotificationMode is enum and you can choose one of three options:

  • BACKGROUND_ONLY - notification will show only when the app is closed or in idle mode.
  • BACKGROUND_AND_FOREGROUND - notification will show every time when push notification comes.
  • SILENT_ONLY - notification never show on the device. If you don't choose one of these options, by default is BACKGROUND_ONLY. This feature is available only for user who use SDK above 5.0.10.

AppoxeeOptions. The server is enum and you can choose one of four options:

  • L3
  • EMC
  • CROC
  • TEST

An account manager will provide you info which one you should use in your application (L3, EMC or CROC).
Our developers use TEST for development purpose and you shouldn't use this one.


If you don't choose one of these options, by default is a TEST. This feature is available only for users who use SDK 6.0.0 and above.
In SDK 6.0.0 and above is opt.cepURL= CEP URL is optional.

You can find older version of SDK at this link

android-sdk's People

Contributors

acamarinkovic avatar aleksandravujadinovic avatar semsudin-tafilovic avatar

Watchers

 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.