com.facebook.ads.AdSettings Java Examples

The following examples show how to use com.facebook.ads.AdSettings. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AdSettingsManager.java    From react-native-fbads with MIT License 5 votes vote down vote up
private void restoreSettings() {
    for (String hash: mTestDeviceHashes) {
        AdSettings.addTestDevice(hash);
    }

    AdSettings.setIsChildDirected(mIsChildDirected);
    AdSettings.setMediationService(mMediationService);
    AdSettings.setUrlPrefix(mUrlPrefix);
}
 
Example #2
Source File: FacebookMediationAdapter.java    From googleads-mobile-android-mediation with Apache License 2.0 5 votes vote down vote up
/**
 * Sets the Facebook mixed audience settings.
 */
public static void setMixedAudience(@NonNull MediationAdConfiguration mediationAdConfiguration) {
  if (mediationAdConfiguration.taggedForChildDirectedTreatment()
      == RequestConfiguration.TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE) {
    AdSettings.setMixedAudience(true);
  } else if (mediationAdConfiguration.taggedForChildDirectedTreatment()
      == RequestConfiguration.TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE) {
    AdSettings.setMixedAudience(false);
  }
}
 
Example #3
Source File: FacebookAdapter.java    From googleads-mobile-android-mediation with Apache License 2.0 5 votes vote down vote up
private void buildAdRequest(MediationAdRequest adRequest) {
  if (adRequest != null) {
    if (adRequest.taggedForChildDirectedTreatment() ==
        MediationAdRequest.TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE) {
      AdSettings.setMixedAudience(true);
    } else if (adRequest.taggedForChildDirectedTreatment() ==
        MediationAdRequest.TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE) {
      AdSettings.setMixedAudience(false);
    }
  }
}
 
Example #4
Source File: AdSettingsManager.java    From react-native-fbads with MIT License 4 votes vote down vote up
@ReactMethod
public void addTestDevice(String deviceHash) {
    AdSettings.addTestDevice(deviceHash);
    mTestDeviceHashes.add(deviceHash);
}
 
Example #5
Source File: AdSettingsManager.java    From react-native-fbads with MIT License 4 votes vote down vote up
@ReactMethod
public void clearTestDevices() {
    AdSettings.clearTestDevices();
    mTestDeviceHashes.clear();
}
 
Example #6
Source File: AdSettingsManager.java    From react-native-fbads with MIT License 4 votes vote down vote up
@ReactMethod
public void setIsChildDirected(boolean isChildDirected) {
    AdSettings.setIsChildDirected(isChildDirected);
    mIsChildDirected = isChildDirected;
}
 
Example #7
Source File: AdSettingsManager.java    From react-native-fbads with MIT License 4 votes vote down vote up
@ReactMethod
public void setMediationService(String mediationService) {
    AdSettings.setMediationService(mediationService);
    mMediationService = mediationService;
}
 
Example #8
Source File: AdSettingsManager.java    From react-native-fbads with MIT License 4 votes vote down vote up
@ReactMethod
public void setUrlPrefix(String urlPrefix) {
    AdSettings.setUrlPrefix(urlPrefix);
    mUrlPrefix = urlPrefix;
}
 
Example #9
Source File: AdSettingsManager.java    From react-native-fbads with MIT License 4 votes vote down vote up
private void clearSettings() {
    AdSettings.clearTestDevices();
    AdSettings.setIsChildDirected(false);
    AdSettings.setMediationService(null);
    AdSettings.setUrlPrefix(null);
}