These instructions give an overview of integrating the MobileFuse SDK with your Android app.
Current Version
...
Integration Steps Overview
Table of Contents | ||||
---|---|---|---|---|
|
You can also use the MobileFuse SDK with our supported mediation platforms.
Step 1. Download the MobileFuse Android SDK
The MobileFuse SDK is distributed on Maven Central and we recommend including the SDK into your project using Gradle.
Gradle Setup
1- Ensure that mavenCentral
is included in your settings.gradle file:
Code Block | ||
---|---|---|
| ||
repositories {
// [... other project repos]
mavenCentral()
} |
2- Update your app module’s dependencies to include the MobileFuse SDK:
Code Block |
---|
dependencies {
// [... other project dependencies]
implementation 'com.mobilefuse.sdk:mobilefuse-sdk-core:1.3.1'
} |
Expand | ||
---|---|---|
| ||
Ensure that your project includes Java 8 language support - our SDK requires support for this language level.
|
Step 2. Configure Data Privacy
Excerpt | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
The MobileFuse SDK supports privacy configurations that can be managed using an IAB compatible US Privacy String, and IAB Consent Framework strings for GDPR. You can also notify the SDK whether your user subject to COPPA, due to them being under 13 years of age. The following snippet demonstrates configuration for the US privacy and COPPA compliance:
GDPR for European usersFor your European users, you must supply an IAB-compatible privacy consent string. The following example shows how to declare consent for a user which is subject to GDPR due to being located in an EAA country. Note that this can simply be chained to the same MobileFusePrivacyPreferences.Builder() as above.
|
Step 3. Initialize the SDK
To initialize the SDK, you’ll need to provide a valid App ID.
Info |
---|
If you don’t have an App ID for the SDK, please ask your MobileFuse contact. You’ll be given a unique App ID for each app and each platform that you publish to. |
The following code snippet demonstrates a simple SDK initialization. Implementation of the init callback listener is optional, but the ‘success’ callback is a good place to set up the ad units for your app.
Code Block | ||
---|---|---|
| ||
int publisherId = 0000;
int appId = 00000;
MobileFuse.init(this, publisherId, appId, new SdkInitListener() {
@Override
public void onInitSuccess() {
// SDK is initialized. You can proceed with creating ad instances
// and loading ads
}
@Override
public void onInitError() {
// SDK failed to initialize - for example no network connection or invalid app ID
}
}); |
Step 4. Create Ad Units
Once the SDK has initialized, you can start using MobileFuse ad units. The following guides provide steps to get started with each of our supported ad formats:
...
...
...
This page has moved to our new documentation:
...