These instructions give an overview of integrating the MobileFuse SDK with your Android app.
Current Version
Integration Steps Overview
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:
repositories { // [... other project repos] mavenCentral() }
2- Update your app module’s dependencies to include the MobileFuse SDK:
dependencies { // [... other project dependencies] implementation 'com.mobilefuse.sdk:mobilefuse-sdk-core:1.2.4' }
Step 2. Configure Data Privacy
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:
MobileFusePrivacyPreferences privacyPrefs = new MobileFusePrivacyPreferences.Builder() .setSubjectToCoppa(false) // should be true if user is under 13 years of age .setUsPrivacyConsentString("<US Privacy String>") // e.g. 1YNN .build(); MobileFuse.setPrivacyPreferences(privacyPrefs);
GDPR for European users
For 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.
MobileFusePrivacyPreferences privacyPrefs = new MobileFusePrivacyPreferences.Builder() .setIabConsentString("<IAB Consent String>") .build(); MobileFuse.setPrivacyPreferences(privacyPrefs);
To ensure that you get reliable ad fill and the best CPMs, please ensure that you implement the data privacy methods that are relevant to your user.
Step 3. Initialize the SDK
To initialize the SDK, you’ll need to provide a valid App ID.
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.
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: