Skip to content

Feature/admob 2021 Set|Get RequestConfiguration #665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Sep 22, 2021

Conversation

DellaBitta
Copy link
Contributor

@DellaBitta DellaBitta commented Sep 15, 2021

Added functions which allow customers to configure the types of Ads that Admob returns. Whereas this configuration used to be done per AdRequest, this new implementation moves the configuration into the global scope.

  • Implemented the Sets and Gets on Android and iOS.
  • Created stubs for desktop.
  • Added tests to the integration test framework.
  • Added iOS utility functions to convert NSArray of NSString objects to a vector of std::string objects.

@google-cla google-cla bot added the cla: yes label Sep 15, 2021
// Convert a NSArray into a vector of strings. Asserts if a non NSString
// object is found in the array.
void NSArrayToStdStringVector(NSArray* array,
std::vector<std::string>* string_vector);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is confusing the linter. #include is indeed at the top of this file.

@DellaBitta
Copy link
Contributor Author

/// @note: on iOS, the
/// @ref RequestConfiguration::tag_for_child_directed_treatment and
/// @ref RequestConfiguration::tag_for_under_age_of_consent fields will be set
/// set to kChildDirectedTreatmentUnspecified, and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "set" is written twice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, will fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -192,6 +193,11 @@ void ForEachAppDelegateClass(void (^block)(Class));
NSMutableArray *StringVectorToNSMutableArray(
const std::vector<std::string> &vector);

// Convert a NSArray into a vector of strings. Asserts if a non NSString
// object is found in the array.
void NSArrayToStdStringVector(NSArray* array,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

soft suggested name: NSArrayOfNSStringToVectorOfString

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -24,16 +24,6 @@
GADRequest *GADRequestFromCppAdRequest(AdRequest adRequest) {
// Create the GADRequest.
GADRequest *request = [GADRequest request];

// Test devices.
if (adRequest.test_device_id_count > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these set elsewhere now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they were once per ad request, now they're part of RequestConfiguration structure. set globally through SetRequestConfigration(). No need to set them each and every time anymore!

Base automatically changed from feature/admob_2021_baseline to feature/admob_2021 September 21, 2021 17:37
// Convert a NSArray into a vector of strings. Asserts if a non NSString
// object is found in the array.
void NSArrayOfNSStringToVectorOfString(NSArray* array,
std::vector<std::string>* string_vector);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Lint warning: Add #include <vector> for vector<>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is confusing the linter. #include is indeed at the top of this file.

@DellaBitta DellaBitta merged commit 80f50ff into feature/admob_2021 Sep 22, 2021
@github-actions github-actions bot added the tests: in-progress This PR's integration tests are in progress. label Sep 22, 2021
@github-actions
Copy link

github-actions bot commented Sep 22, 2021

❌  Integration test FAILED

Requested by @DellaBitta on commit 80f50ff
Last updated: Wed Sep 22 16:31 PDT 2021
View integration test log & download artifacts

Failures Configs
missing_log [TEST] [ERROR] [Android] [windows] [emulator_target]
admob [TEST] [ERROR] [Android] [macos] [android_target]
messaging [TEST] [ERROR] [Android] [All os] [android_target]

Add flaky tests to go/fpl-cpp-flake-tracker

@DellaBitta DellaBitta deleted the feature/admob_2021_set_configuration branch September 22, 2021 20:38
@github-actions github-actions bot added the tests: failed This PR's integration tests failed. label Sep 22, 2021
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Sep 22, 2021
@firebase firebase locked and limited conversation to collaborators Oct 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes tests: failed This PR's integration tests failed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants