Search in sources :

Example 1 with AppInfoParameterBuilder

use of org.prebid.mobile.rendering.networking.parameters.AppInfoParameterBuilder in project prebid-mobile-android by prebid.

the class Requester method getParameterBuilders.

protected List<ParameterBuilder> getParameterBuilders() {
    Context context = mContextReference.get();
    Resources resources = null;
    if (context != null) {
        resources = context.getResources();
    }
    boolean browserActivityAvailable = ExternalViewerUtils.isBrowserActivityCallable(context);
    ArrayList<ParameterBuilder> parameterBuilderArray = new ArrayList<>();
    parameterBuilderArray.add(new BasicParameterBuilder(mAdConfiguration, resources, browserActivityAvailable));
    parameterBuilderArray.add(new GeoLocationParameterBuilder());
    parameterBuilderArray.add(new AppInfoParameterBuilder(mAdConfiguration));
    parameterBuilderArray.add(new DeviceInfoParameterBuilder(mAdConfiguration));
    parameterBuilderArray.add(new NetworkParameterBuilder());
    parameterBuilderArray.add(new UserConsentParameterBuilder(mUserConsentManager));
    return parameterBuilderArray;
}
Also used : Context(android.content.Context) AppInfoParameterBuilder(org.prebid.mobile.rendering.networking.parameters.AppInfoParameterBuilder) DeviceInfoParameterBuilder(org.prebid.mobile.rendering.networking.parameters.DeviceInfoParameterBuilder) GeoLocationParameterBuilder(org.prebid.mobile.rendering.networking.parameters.GeoLocationParameterBuilder) ArrayList(java.util.ArrayList) NetworkParameterBuilder(org.prebid.mobile.rendering.networking.parameters.NetworkParameterBuilder) UserConsentParameterBuilder(org.prebid.mobile.rendering.networking.parameters.UserConsentParameterBuilder) Resources(android.content.res.Resources) GeoLocationParameterBuilder(org.prebid.mobile.rendering.networking.parameters.GeoLocationParameterBuilder) BasicParameterBuilder(org.prebid.mobile.rendering.networking.parameters.BasicParameterBuilder) NetworkParameterBuilder(org.prebid.mobile.rendering.networking.parameters.NetworkParameterBuilder) UserConsentParameterBuilder(org.prebid.mobile.rendering.networking.parameters.UserConsentParameterBuilder) ParameterBuilder(org.prebid.mobile.rendering.networking.parameters.ParameterBuilder) AppInfoParameterBuilder(org.prebid.mobile.rendering.networking.parameters.AppInfoParameterBuilder) DeviceInfoParameterBuilder(org.prebid.mobile.rendering.networking.parameters.DeviceInfoParameterBuilder) BasicParameterBuilder(org.prebid.mobile.rendering.networking.parameters.BasicParameterBuilder)

Example 2 with AppInfoParameterBuilder

use of org.prebid.mobile.rendering.networking.parameters.AppInfoParameterBuilder in project prebid-mobile-android by prebid.

the class AutoDetectedOpenRtbTest method overwrittenAppInfoParameterBuilder.

@Test
public void overwrittenAppInfoParameterBuilder() {
    mOriginalOpenRtbParams.getApp().name = "foo";
    mOriginalOpenRtbParams.getApp().bundle = "foo";
    mOriginalOpenRtbParams.getDevice().ifa = "foo";
    mOriginalOpenRtbParams.getDevice().lmt = 0;
    AppInfoManager.setAppName("bar");
    AppInfoManager.setPackageName("bar");
    AdIdManager.setAdId("bar");
    AdIdManager.setLimitAdTrackingEnabled(true);
    mParamBuilderArray.add(new AppInfoParameterBuilder(new AdConfiguration()));
    AdRequestInput newAdRequestInput = URLBuilder.buildParameters(mParamBuilderArray, mOriginalAdRequestInput);
    BidRequest newOpenRtbParams = newAdRequestInput.getBidRequest();
    assertNotEquals(mOriginalOpenRtbParams.getApp().name, newOpenRtbParams.getApp().name);
    assertNotEquals(mOriginalOpenRtbParams.getApp().bundle, newOpenRtbParams.getApp().bundle);
    assertNotEquals(mOriginalOpenRtbParams.getDevice().ifa, newOpenRtbParams.getDevice().ifa);
    assertNotEquals(mOriginalOpenRtbParams.getDevice().lmt, newOpenRtbParams.getDevice().lmt);
}
Also used : AppInfoParameterBuilder(org.prebid.mobile.rendering.networking.parameters.AppInfoParameterBuilder) AdRequestInput(org.prebid.mobile.rendering.networking.parameters.AdRequestInput) AdConfiguration(org.prebid.mobile.rendering.models.AdConfiguration) BidRequest(org.prebid.mobile.rendering.models.openrtb.BidRequest) Test(org.junit.Test)

Aggregations

AppInfoParameterBuilder (org.prebid.mobile.rendering.networking.parameters.AppInfoParameterBuilder)2 Context (android.content.Context)1 Resources (android.content.res.Resources)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 AdConfiguration (org.prebid.mobile.rendering.models.AdConfiguration)1 BidRequest (org.prebid.mobile.rendering.models.openrtb.BidRequest)1 AdRequestInput (org.prebid.mobile.rendering.networking.parameters.AdRequestInput)1 BasicParameterBuilder (org.prebid.mobile.rendering.networking.parameters.BasicParameterBuilder)1 DeviceInfoParameterBuilder (org.prebid.mobile.rendering.networking.parameters.DeviceInfoParameterBuilder)1 GeoLocationParameterBuilder (org.prebid.mobile.rendering.networking.parameters.GeoLocationParameterBuilder)1 NetworkParameterBuilder (org.prebid.mobile.rendering.networking.parameters.NetworkParameterBuilder)1 ParameterBuilder (org.prebid.mobile.rendering.networking.parameters.ParameterBuilder)1 UserConsentParameterBuilder (org.prebid.mobile.rendering.networking.parameters.UserConsentParameterBuilder)1