SDK Options
The following methods are available to adjust the behavior of the SDK. Some are set per-placement by your Account Manager (server side), while others allow you to specify them with code (client side).
Video: Sound Muting
This controls the default muting behavior of ads. By default the SDK will play interstitial/rewarded ad videos with sound, but videos in banner/MREC ads will begin muted. If you prefer different behavior, there are two ways to achieve this:
- Your Account Manager can change the behavior for the ad placement so that interstitial/rewarded ads are muted by default, or so that banner/MREC ads play with sound.
- You can override the muting of an ad programmatically, for example if you have a sound toggle option for your app users, by using the following methods:
interstitialAdInstance.setMuted(true)
interstitialAdInstance.showAd()
[self.interstitialAdInstance setMuted:YES];
[self.interstitialAdInstance showAd];
interstitial.setMuted(true)
interstitial.showAd()
interstitial.setMuted(true);
interstitial.showAd();
This takes priority over any server side setting specified by your Account Manager.
Video: Clickthrough Behavior
This controls how the clickthrough for a video ad works. There are two options that can be set by your Account Manager:
- Standard clickthrough: The whole video and Call to Action (CTA) button can be tapped to activate the clickthrough.
- CTA-only clickthrough: Only the CTA button can be tapped to activate the clickthrough.
The CTA button is a “Learn More” button shown as part of the video player UI. This option can be used to ensure more intentional click engagement from your app users.
Video: Skippable After Seconds
This option can be set by your Account Manager and allows you to specify an amount of time before the close button will display for the video ad. It is primarily used for Rewarded Ads that require the user to watch the ad for a minimum specified time.
Video: Force Show Skip Seconds
This option can be set by your Account Manager and allows you to specify an amount of time after which the close button is forced to display, regardless of what the ad creative specifies. This is useful if you want to ensure that all videos are skippable within 5 seconds, for example.
Note that the default behavior is for the ad creative to control this, so it does not need to be specified unless you have a good reason to override that behavior for a particular ad placement.
Video: Max End Cards
This can be set by your account manager and it limits the number of end cards (or companion ads) that display directly after a video ad. Note that this only includes end cards provided by the ad creative itself; in performance campaigns MobileFuse may add additional pages to ads in order to optimize user engagement, and this particular setting does not affect those pages.
Getting the Creative ID (CRID) v1.7.2+
v1.7.2+
For debugging purposes, or at the request of your account manager, you can get the Creative ID (CRID) of a particular loaded ad instance by using the following methods:
if let winningBidInfo = ad.winningBidInfo {
print("CRID: \(winningBidInfo.creativeId ?? "Not set")")
}
MFWinningBidInfo *winningBidInfo = bannerAd.winningBidInfo; // From a banner ad instance for example
if (winningBidInfo != nil) {
NSLog(@"CRID: %@", ad.winningBidInfo.creativeId); // Get the Creative ID
}
val bidInfo = bannerAd.winningBidInfo // From a banner ad instance for example
if (bidInfo != null) {
logDebug("CRID: ${bidInfo.creativeId}") // Get the Creative ID
}
WinningBidInfo bidInfo = bannerAd.getWinningBidInfo(); // From a banner ad instance for example
if (bidInfo != null) {
logDebug("CRID: " + bidInfo.getCreativeId()); // Get the Creative ID
}
Note that it is also automatically logged in the device console for convenience (as Winning bid received with CRID: x
for Android, or "Loaded ad with creative ID: x
for iOS).
User Age and Gender Support
The MobileFuse SDK now supports the OpenRTB standard 'gender' and 'year of birth' fields. You can optionally pass this information to the SDK using the following methods:
// Optionally set year of birth, or age. (age will be converted to an approximate year of birth):
[MobileFuseTargetingData setYearOfBirth:1980];
[MobileFuseTargetingData setAge:40];
// Optionally set the user gender:
[MobileFuseTargetingData setGender: MOBILEFUSE_TARGETING_DATA_GENDER_FEMALE] // User is female
[MobileFuseTargetingData setGender: MOBILEFUSE_TARGETING_DATA_GENDER_MALE] // User is male
[MobileFuseTargetingData setGender: MOBILEFUSE_TARGETING_DATA_GENDER_OTHER] // Known to be other gender
[MobileFuseTargetingData setGender: MOBILEFUSE_TARGETING_DATA_GENDER_UNKNOWN] // Unset any previously set value
// Optionally set year of birth, or age. (age will be converted to an approximate year of birth):
MobileFuseTargetingData.yearOfBirth = 1980
MobileFuseTargetingData.age = 40
// Optionally set the user gender:
import com.mobilefuse.sdk.user.Gender
MobileFuseTargetingData.gender = Gender.FEMALE // User is female
MobileFuseTargetingData.gender = Gender.MALE // User is male
MobileFuseTargetingData.gender = Gender.OTHER // Known to be other gender
MobileFuseTargetingData.gender = Gender.UNKNOWN // Unset any previously set value
// Optionally set year of birth, or age. (age will be converted to an approximate year of birth):
MobileFuseTargetingData.setYearOfBirth(1980);
MobileFuseTargetingData.setAge(40);
// Optionally set the user gender:
import com.mobilefuse.sdk.user.Gender
MobileFuseTargetingData.setGender(Gender.FEMALE); // User is female
MobileFuseTargetingData.setGender(Gender.MALE); // User is male
MobileFuseTargetingData.setGender(Gender.OTHER); // Known to be other gender
MobileFuseTargetingData.setGender(Gender.UNKNOWN); // Unset any previously set value
Extended ID Opt-Out v1.6.4+
v1.6.4+
We have partner integrations within the MobileFuse SDK which offer an easy way to hook into LiveRamp RampID and Neustar's FabrickID for UID2-based extended ID user targeting.
If you would like to opt out of this, you can call methods in MobileFuseTargetingData
before invoking any other SDK methods as in the following examples:
@import MobileFuseSDK;
// Disable LiveRamp partner integration (RampID)
[MobileFuseTargetingData setVendorEnabled:NO
forVendor:@"liveramp.com"];
import MobileFuseSDK
// Disable LiveRamp partner integration (RampID)
MobileFuseTargetingData.setVendorEnabled(false,
forVendor:"liveramp.com")
// Disable LiveRamp partner integration (RampID)
MobileFuseTargetingData.setVendorEnabled("liveramp.com", false);
// Disable LiveRamp partner integration (RampID)
MobileFuseTargetingData.setVendorEnabled("liveramp.com", false)
Alternatively, you can add AndroidManifest.xml or Info.plist keys:
<key>MFVendorEnableLiveRamp</key>
<false/>
<!-- In your AndroidManifest.xml -->
<application ...>
<meta-data android:name="com.mobilefuse.sdk.vendor_enable_liveramp" android:value="false" />
<activity ...
</application>
Updated 7 days ago