Skip to content

GMA Merge to Main #1001

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 124 commits into from
Jun 23, 2022
Merged

GMA Merge to Main #1001

merged 124 commits into from
Jun 23, 2022

Conversation

DellaBitta
Copy link
Contributor

Description

Provide details of the change, and generalize the change in the PR title above.

Merge the GMA SDK Feature Branch to main.


Testing

Describe how you've tested these changes. Link any manually triggered Integration tests or CPP binary SDK Packaging Github Action workflows, if applicable.


Type of Change

Place an x the applicable box:

  • Bug fix. Add the issue # below if applicable.
  • New feature. A non-breaking change which adds functionality.
  • Other, such as a build process or documentation change.

DellaBitta and others added 30 commits September 21, 2021 13:34
* Android pinned to new version

* Updates to Admob Android to reduce usage of BannerViewHelper.java (#624)

* removed some BannerViewHelper code, the rest requires upcoming listener revamp

* added <string.h> include to banner_view_internal_android.cc

* iOS Baseline to build upon for the Admob 2021 SDK (#625)

* removed nativeAdExpress and rewardedVideo iOS impls
* removed extra comma in admob testapp project

* fixed lint errors

* linting fixes

* add new line to the end of BannerViewHelper.java

* update use of futures in initialization

* Updated error string

* Fix request builder Android leak

* check completions in both directions

* format fixes

* Skip AlreadyInitialized on Desktop
* Android pinned to new version

* Updates to Admob Android to reduce usage of BannerViewHelper.java (#624)

* removed some BannerViewHelper code, the rest requires upcoming listener revamp

* added <string.h> include to banner_view_internal_android.cc

* iOS Baseline to build upon for the Admob 2021 SDK (#625)

* removed nativeAdExpress and rewardedVideo iOS impls
* removed extra comma in admob testapp project

* fixed lint errors

* linting fixes

* add new line to the end of BannerViewHelper.java

* ios set configuration impl

* Integration test on iOS

* desktop integration test passes

* Android implementation and tests pass

* lint fixes

* lint fixes

* lint fixes

* copy paste error

* desktop test fix

* updated NSArrayOfNSStringToVectorOfString name

* removed test device ids from request converter.  Missed on merge
Updated the AdSize and AdRequest structures:
 - Converted them to classes.
 - AdRequest now has methods to manipulate the content url, keywords and network extras.  
 - Extras are are now collections with mediation class names keys.  The class names now dynamically resolved to jclasses on on Android and GADSize objects on iOS, as these objects are required as part of the Admob phone SDK API when setting extras.
 - AdSize now provides methods for Adaptive sizes, and includes constants for common ad sizes.
 
Banner and Interstitial ads were updated to use these new structures.

Updated Itests
 - Some unit testing is done on these structures.
 - Added pauses between banner ad move commands as they were moving too quickly for Android phones to properly render them (they flashed as blank black boxes.)

[iTest execution](https://github.com/firebase/firebase-cpp-sdk/actions/runs/1271413043)
[Packaging execution 1](https://github.com/firebase/firebase-cpp-sdk/actions/runs/1293182830) [Packaging execution 2, expanded](https://github.com/firebase/firebase-cpp-sdk/actions/runs/1295146882) - builds fine, some test failures in unrelated storage and messaging code.
LoadAd operations on BannerView and Interstitial Ads now return a LoadAdResult.  On error this contains information from the AdMob service as to why a failure occurred.  The C++ SDK also uses it to return errors that may have occurred when attempting to marshal the Android and iOS SDKs.

The implementation obfuscates Objective C pointers and Android references via Internal structs. These are forward declared in our public API and defined internally.  These structs are passed to AdapterResponseInfo, AdResult, LoadAdResult and ResponseInfo class constructors.

Other changes include:
 - Updated the use of Futures in BannerView and InterstitialAd to use SafeFutures.
 - Removed the use GetLastResult to construct future objects, and its use opens up the potential issue of race conditions. Replaced this implementation with MakeFuture.
 - Moved LoadAd error code mappings from Android and iOS to C++ code.
 - Updated integration tests to include the following scenarios for both Interstitial and Banner Ads
   - Duplicate initialization invocations on the same object.
   - Duplicate loadAd requests on the same object.
   - The use of an errant AdUnitId string
 - Reenabled a multithreaded deletion test that was previously disabled due to a now obsolete Android bug
 - Added a LoadAd integration test that doesn't require user interaction, so that we can run it on FTL.
 - Updated iOS Admob SDK to 8+, and reworked the InterstitialDelegates and Loading process to match the new 8.0 flow.

[Integration Test run](https://github.com/firebase/firebase-cpp-sdk/actions/runs/1408627388)
### Description
 - iOS & Android dependencies increased to latest AdMob version to support AdClicked events.
 - Implemented AdListener, FullScreenContent, and PaidEvent listeners. These listener signatures track closely with the iOS and Android counterparts so that they may easily be expanded and supported.
 - Removed PresentationStateListeners. Similar functionality is now facilaited by AdListeners and FullScreenContentListeners.
 - Methods for ad placement renamed from `MoveTo` to `SetPosition` to align with AdMob's iOS and Android SDKs.
 - Invoking methods on BannerView and InterstitialAds now properly fail on "uninitialized" objects.  Previously empty / invalid futures were returned from most methods.
 - Fixed an hang on `loadAd` calls for uninitialized BannerViews and InterstialAds.
 - More thorough shut down / destruction of ad objects ensure consistency and reduce potential flake.
 - Integration test updates:
   - New manual tests track Bounding Box, AdView, FullScreenPresentation and Paid events when clicking through ads. 
   - Added higher-fidelity checks of bounding box state. Bounding box change behaviors across Android and iOS are now consistent.
   - Added a "stress" test of loading and releasing 10 BannerView ads and 10 Interstitial Ads in tight succession.
   - `Destroy()` is now called to properly clean up BannerViews.
   - Expanded coverage of error scenarios: uninitialized ads, duplicate load requests, etc.
### Description
Remove LoadAdResult and fold it's data into AdResult.

The ResponseInfo member of LoadAdResult now resides in AdResult and will only be populated in Results that stem from `loadAd` requests.

**Note:** With this new class / data member topography, there isn't an order in which I could declare AdResult in types.h without the compiler complaining that it needed a definition of its ResponseInfo member.  I solved this by making the member a _pointer_ to a ResponseInfo and this made the compiler very happy.  We're friends now.
* Change admob::Initialize to return adapter initialization status.

* Updated integration test to confirm the default adapter (depending on platform) is present in the list.

* Move template functions to the .h file to fix linker issue.

* Fix ifdef for windows / Android

* Fix build warning in desktop stub.
### Description
> Provide details of the change, and generalize the change in the PR title above.

- Implemented RewardedAd on Android, and created stubs for iOS and Desktop builds.
- Revamped C++ JNI function signatures to have much shorter names, and to reuse functions common to interstitial and rewarded ads.
- Created a new internal base class for full screen event listeners to share its implementation across RewardedAds and InsterstitialAds.  This allows us to reuse some JNI callback functions.
- Grouped those integration tests which require user interaction so that they execute one after the next, and front load them to the start of the itest flow (after a few quick sanity checks).  This should make running the manual tests easier.
Merge updates from main branch into admob_2021 feature branch
Check to see if Interstitial and BannerView callback pointers have been nullified before invoking them in Java.
Rename Admob LeaderBoard AdSize to Leaderboard to match AdMob naming conventions.
Updates the iOS implement to be able to display rewarded ads.
Fix stability issues regarding race conditions in the AdMob SDK:
 - Ensure that future objects are fully created before launching async operations which use their handles.
 - Remove the blocking destructor of BannerView on Android. 
   - There was a race condition where the the future might be destroyed before the destroy method returns from Android causing an assertion in the Future implementation.
 - Remove the blocking destructors of Interstitial and Rewarded Ads on iOS.
   - These implementations don't invoke AdMob objects and so don't need to be run on the main thread.
* Fix test on emulator workflow failures (#734)

* If simulator  install ios app failed, reset simulator and try again (#733)

* Trigger workflow move github api cod to github.py (#746)

* Fix a data race that could manifest as null pointer dereference in FutureBase::Release() (#747)

* Cancel callbacks for messaging (#745)

* Cancel callbacks for messaging

util::Terminate is referenced counted som when there ar more APIs than messaging active the callbacks will not be canceled until later and still cause a NULL ref due to the FutureData being destroyed now.

* Cancel callback earlier

* Update readme

* Remove "Android" tag from the release notes entry for #747 (#749)

* Remove calls to LogInfo, LogError, LogDebug during obj-c +load. (#706)

* Remove calls to LogInfo, LogError, LogDebug during obj-c +load.

This could be causing an issue in C++ as global class constructors have not yet been run.

* Add Objective-C/C++ and Java to code formatter script; format those files. (#755)

* Allow format_code to format .m/.mm files; clang-format already knows how.

* Run format_code.py on all objective-c/objective-c++ files.

* Add Java file extensions to format_code.py

* Format all Java source files.

* Remove check for objc header, as they are now supported.

* Format objective-c .h files.

* Don't let lint comment on line length any more; code formatting will report that.

* Messaging crash during initialization (#760)

* Messaging crash during initialization

* Update readme

* Don't redeclare inherited state in CredentialsProviderDesktop (#731)

* Reduce disk space usage when packaging the built SDK (#763)

Remove intermediate build files during desktop packaging step.

This should reduce the disk space usage, as those files (*.o and *.obj) are not required when merging libraries.

* Workaround for Linux x86 build:  downgrade libraries on GitHub runners (#764)

When installing 32-bit Linux dependencies on GitHub runners, downgrade libpcre2-8-0 to an earlier version to ensure compatibility with the i386 version of the package. This is something that should be fixed in a subsequent Ubuntu release and so is a temporary workaround.

This also adds checks to the various prerequisite commands run by build_desktop.py, which was previously just silently ignoring errors (making this much harder to track down). Now it will error out as soon as a command fails.

Co-authored-by: Mou Sun <[email protected]>
Co-authored-by: Denver Coneybeare <[email protected]>
Co-authored-by: Tobias Barendt <[email protected]>
Co-authored-by: Jon Simantov <[email protected]>
Co-authored-by: Sebastian Schmidt <[email protected]>
* Fix link in readme (#768)

* update test devices (#757)

* Timeout and Retry FTL failures and mark flakiness

* Update C++ SDK version to 8.8.0.

* Add Analytics header update to iOS SDK update. (#775)

* Add Analytics header update to iOS SDK update.

* Update Android dependencies - Wed Dec 01 2021 (#773)

### Android

- com.google.firebase.firebase_database → 20.0.3
- com.google.firebase.firebase_perf → 20.0.4

> Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/1527401903).

Co-authored-by: firebase-workflow-trigger-bot <[email protected]>

* Fix typo in log output.

* Change Xcode version from 12.2 to 12.4 to ensure GitHub support. (#774)

* Change Xcode version from 12.2 to 12.4 to ensure GitHub support.

* Fix integration tests workflow to respect xcode_version in matrix.

* Add extra newline to header comment.

* Update iOS dependencies - Thu Dec 02 2021 (#779)

* Update iOS dependencies - Thu Dec 02 2021

### iOS

- Firebase/Analytics → 8.10.0
- Firebase/Auth → 8.10.0
- Firebase/Core → 8.10.0
- Firebase/Crashlytics → 8.10.0
- Firebase/Database → 8.10.0
- Firebase/DynamicLinks → 8.10.0
- Firebase/Firestore → 8.10.0
- Firebase/Functions → 8.10.0
- Firebase/Installations → 8.10.0
- Firebase/Messaging → 8.10.0
- Firebase/RemoteConfig → 8.10.0
- Firebase/Storage → 8.10.0

> Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/1528664697).

* Add missing copyright lines.

* Add Firestore release note.

Co-authored-by: firebase-workflow-trigger-bot <[email protected]>
Co-authored-by: Jon Simantov <[email protected]>

* Properly convert milliseconds to seconds (#767)

* Properly convert milliseconds to seconds

Currently, a value expressed in milliseconds is directly assigned to a variable
which is supposed to store seconds and it's later converted to mills again.
Thus, convert properly upon assignment

* Update readme.md

* Change LogDebug to NSLog in app's swizzling code. (#783)

* Change LogDebug to NSLog.

* Change log message.

* Add comment.

* Add copyright line when importing Analytics iOS headers, if missing (#780)

* Add copyright line to iOS headers

* Make copyright conditional to whether the file already has one.

* Also set Xcode version explicitly in Android workflow. (#786)

* Timeout & retry "install integration test deps" step (#785)

* Format code.

Co-authored-by: Борис Рязанцев <[email protected]>
Co-authored-by: Mou Sun <[email protected]>
Co-authored-by: firebase-workflow-trigger[bot] <80733318+firebase-workflow-trigger[bot]@users.noreply.github.com>
Co-authored-by: firebase-workflow-trigger-bot <[email protected]>
Co-authored-by: pawelsnk <[email protected]>
…content

AdMob AdRequest Neighboring Content URLS
Add iOS-specific functions to disable some automatic services:
  - `DisableSDKCrashReporting()`
  - `DisableMediationInitialization()`

These functions have no behavior on Android.
@google-cla google-cla bot added cla: no and removed cla: yes labels Jun 23, 2022
@DellaBitta DellaBitta added cla: yes tests-requested: quick Trigger a quick set of integration tests. and removed cla: no tests-requested: quick Trigger a quick set of integration tests. labels Jun 23, 2022
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. and removed tests-requested: quick Trigger a quick set of integration tests. labels Jun 23, 2022
@github-actions
Copy link

github-actions bot commented Jun 23, 2022

❌  Integration test FAILED

Requested by @DellaBitta on commit 7e7c593
Last updated: Thu Jun 23 20:41 PDT 2022
View integration test log & download artifacts

Failures Configs
firestore [TEST] [FAILURE] [tvOS] [macos] [tvos_simulator]
(1 failed tests)  CleanupTest.DocumentChangeIsBlankAfterCleanup
[TEST] [FLAKINESS] [Android] [All 2 os] [android_target]
(1 failed tests)  ServerTimestampTest.TestServerTimestampsUsesPreviousValueFromLocalMutation

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

Copy link
Contributor

@jonsimantov jonsimantov left a comment

Choose a reason for hiding this comment

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

Approved as long as the tests pass.

If the UI-enabled tests are broken, please disable them before merging.

@github-actions github-actions bot added the tests: succeeded This PR's integration tests succeeded. label Jun 23, 2022
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Jun 23, 2022
@google-cla google-cla bot added cla: no and removed cla: yes labels Jun 23, 2022
@google-cla google-cla bot added cla: no and removed cla: yes labels Jun 23, 2022
@DellaBitta DellaBitta merged commit 7e7c593 into main Jun 23, 2022
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. tests: failed This PR's integration tests failed. and removed tests: succeeded This PR's integration tests succeeded. labels Jun 23, 2022
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Jun 24, 2022
@firebase firebase locked and limited conversation to collaborators Jul 24, 2022
@DellaBitta DellaBitta deleted the feature/admob_2021 branch August 3, 2022 16:55
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.

3 participants