Search in sources :

Example 1 with GeoLocationParameterBuilder

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

the class AutoDetectedOpenRtbTest method overwrittenGeoLocationParameterBuilderTest.

@Test
public void overwrittenGeoLocationParameterBuilderTest() {
    mOriginalOpenRtbParams.getDevice().getGeo().lat = 0f;
    mOriginalOpenRtbParams.getDevice().getGeo().lon = 0f;
    mOriginalOpenRtbParams.getDevice().getGeo().type = 0;
    mOriginalAdRequestInput.setBidRequest(mOriginalOpenRtbParams);
    mParamBuilderArray.add(new GeoLocationParameterBuilder());
    AdRequestInput newAdRequestInput = URLBuilder.buildParameters(mParamBuilderArray, mOriginalAdRequestInput);
    BidRequest newOpenRtbParams = newAdRequestInput.getBidRequest();
    assertNotEquals(mOriginalOpenRtbParams.getDevice().getGeo().lat, newOpenRtbParams.getDevice().getGeo().lat);
    assertNotEquals(mOriginalOpenRtbParams.getDevice().getGeo().lon, newOpenRtbParams.getDevice().getGeo().lon);
    assertNotEquals(mOriginalOpenRtbParams.getDevice().getGeo().type, newOpenRtbParams.getDevice().getGeo().type);
}
Also used : AdRequestInput(org.prebid.mobile.rendering.networking.parameters.AdRequestInput) GeoLocationParameterBuilder(org.prebid.mobile.rendering.networking.parameters.GeoLocationParameterBuilder) BidRequest(org.prebid.mobile.rendering.models.openrtb.BidRequest) Test(org.junit.Test)

Example 2 with GeoLocationParameterBuilder

use of org.prebid.mobile.rendering.networking.parameters.GeoLocationParameterBuilder 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)

Aggregations

GeoLocationParameterBuilder (org.prebid.mobile.rendering.networking.parameters.GeoLocationParameterBuilder)2 Context (android.content.Context)1 Resources (android.content.res.Resources)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 BidRequest (org.prebid.mobile.rendering.models.openrtb.BidRequest)1 AdRequestInput (org.prebid.mobile.rendering.networking.parameters.AdRequestInput)1 AppInfoParameterBuilder (org.prebid.mobile.rendering.networking.parameters.AppInfoParameterBuilder)1 BasicParameterBuilder (org.prebid.mobile.rendering.networking.parameters.BasicParameterBuilder)1 DeviceInfoParameterBuilder (org.prebid.mobile.rendering.networking.parameters.DeviceInfoParameterBuilder)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