Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.app360:app360-android-sdk:'
}
dependencies {
implementation("com.github.app360:app360-android-sdk:")
}
<dependency>
<groupId>com.github.app360</groupId>
<artifactId>app360-android-sdk</artifactId>
<version></version>
</dependency>
libraryDependencies += "com.github.app360" % "app360-android-sdk" % ""
:dependencies [[com.github.app360/app360-android-sdk ""]]
Other language: Vietnamese
#Introduction
App360SDK provides easiest way to integrate user management into your application. If you want to intergate payment method like SMS, Phone card, E-banking payment, you can use App360PaymentSDK
The App360 SDK supports Android version 4.0 and above.
Firstly, clone or download this repository to your machine.
git clone https://github.com/app360/app360-android-sdk.git
The demo project is compatible with latest versions of both Android Studio and Eclipse.
To import the project into Android Studio, close the current project, choose Open an existing Android Studio project then choose the repository you've just downloaded/cloned.
To import the project into Eclipse, choose File > Import..., then inside the Import dialog, choose General > Existing projects into workspace, then in Select root directory, browse to the repository. Select all projects that Eclipse detected, then click Finish.
Drag package vn.m360.demoscopedid
from java
folder to src
folder
Open LoginActivity inside demo project, find App360SDK.initialize("appId", "appSecret", ...)
line and replace the placeholders with your application credentials.
Run the project. The app demonstrates capability of App360 SDK, including app-scoped ID and payment.
The first thing you need to do to get started with App360 is sign up for a free account. After create account, you can access App360 dashboard to create or manage your apps.
To integrate with App360SDK you need to create new application. Each application has a pair of key (application id and application secret key) that will be used to authorize with SDK’s server.
There are multiple ways to include the App360 SDK into an Android project. We can use Gradle or Maven (coming soon), or manually include the jar and its dependencies
Download App360SDK
Download the Android SDK from the App360 github repo. After downloading the JAR, place it on your application’s classpath. Typically, this is in your libs folder. Depending on your IDE, you may need to explicitly add the library to your project as a dependency.
The App360 library requires the some permissions to operate. Your app will not work unless you add this permission to your AndroidManifest.xml file:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<!-- Remove if SMS payment is not needed or you don't use SDK Payment UI -->
<uses-permission android:name="android.permission.SEND_SMS" />
To import the SDK into your Eclipse project, repeat the same steps for importing demo project, except that in the last step, just select app360sdk
project. Right-click on your project, choose Properties, inside Android > Library, add app360sdk
as a library project dependency.
To import the SDK into Android Studio, follows these steps:
Choose File > Import Module..., then browse to app360sdk
directory inside the repository. Click Finish and wait until the import is completed.
Open File > Project Structure..., select your application module, select Dependencies tab, press the plus (+) symbol in the top-right corner, select Module dependency, then select app360sdk
.
In order to support channeling, the application's assets
directory should contain a properties file named app360.properties
. The file should contain two keys channel
and sub_channel
. channel
is distribution channel such as mwork
, appota
while sub_channel
is arbitrary string defined by the distribution channel itself.
The App360 library must be initialized once with an Android context. This must happen before any App360 app reference is created or used. You can add the setup code to your Android Application’s or Activity’s onCreate method.
App360SDK.initialize("appID", "appSecret", getApplicationContext(), new InitListener() {
@Override
public void onSuccess() {
SessionService.Session session = SessionManager.getCurrentSession();
if (session == null) { // no cached valid session
SessionManager.createSession("your-user-id", new SessionCallback());
} else {
Log.d(TAG, "Current session: " + session);
}
}
@Override
public void onFailure(Exception e) {
Log.e(TAG, "Initialization error", e);
}
});
You can get appID and appSecret in the code example above from App360 dashboard. Login your account, choose the app you are working on and you will see the keys you need in Information tab
Channeling is done per app-scoped ID. In other words, the channel of a payment equals to the channel of the app-scoped user that orders such payment. Moreover, an app-scoped user's channel is decided at creation and equals to the channel specified in app360.properties
of the build that creates it. So:
If you want channeling be done on user level, you should synchronize your app's users with app-scoped ID (i.e. set your app's user ID as scopedId
in
public static void createSession(String scopedId, SessionCallback callback);
If you want channeling be done on device level, you should set device ID as scopedId
in
public static void createSession(String scopedId, SessionCallback callback);
#Release Notes
** Release date **: 17 March 2016
** Release date **: 19 Jun 2015
** Release date **: 02 Feb 2015
#Support Please contact us for general inquiries.
##For a technical issue In case you have a technical issue, you can reach our technical support team. Please provide the following information when you reach out, it'll allow us to help you much more quickly.
App360SDK.getVersion();
method.For more information, please go to https://developers.app360.vn.