Skip to content
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

RFC: Version 2 #165

Merged
merged 56 commits into from
Oct 3, 2017
Merged

RFC: Version 2 #165

merged 56 commits into from
Oct 3, 2017

Conversation

koenpunt
Copy link
Collaborator

@koenpunt koenpunt commented Aug 2, 2017

General

  • The banner views are now instantiated by React instead of vending an instance from the manager.
  • The loadBanner method is now exposed to react, to allow easy banner refresh, and removes the need of checking which properties are available before making a request to admob.
  • The exported view properties now match the properties of the DFPBannerView/GADBannerView (the iOS library classes).
  • Implemented the validAdSizes property for DFP banners
  • replaced the testDeviceID property with testDevices. Also the simulator device id can be specified using PublisherBanner.simulatorId/AdMobBanner.simulatorId instead of "EMULATOR".
  • Fixed the implementation for onAdmobDispatchAppEvent.
  • All function props and events have been normalized.
1.3 2.0
onAdViewDidReceiveAd onAdLoaded
onDidFailToReceiveAdWithError onAdFailedToLoad
onAdViewWillPresentScreen onAdOpened
onAdViewWillDismissScreen onAdClosed
onAdViewWillLeaveApplication onAdLeftApplication
onDidReceiveAppEvent onAppEvent
interstitialDidLoad
rewardedVideoDidLoad
adLoaded
interstitialDidFailToLoad
rewardedVideoDidFailToLoad
adFailedToLoad
interstitialDidOpen
rewardedVideoDidOpen
adOpened
interstitialDidClose
rewardedVideoDidClose
adClosed
interstitialWillLeaveApplication
rewardedVideoWillLeaveApplication
adLeftApplication
rewardedVideoDidRewardUser rewarded

iOS Specific

  • The conversion of json to GADAdSize is now implemented using a RCTConvert category.
  • The onSizeChange handler is now also called through the GADAdSizeDelegate in addition to comparing the bounds of the view to the adsize.
  • Replaced remaining use of deprecated RCTEventDispatcher with RCTEventEmitter

Android

...

Prerelease

Alpha releases of version 2 are available on npm, which can be installed using;

Yarn

yarn add react-native-admob@next

npm

npm install --save react-native-admob@next

The alpha is safe to use in production (I use it in production in 2 apps with both over 10k users without issues), although you can expect breaking changes in between alpha releases.

TODO

  • Add examples
  • Android
  • Linting
  • Ad targeting (RFC: Targeting support #166)
  • Make autoload optional?
  • Unit tests?
  • Documentation
  • Normalize / unify filenames
  • CocoaPods support?

NB. This builds on my other PR (#149), where I've updated React Native in the example. So just have a look at the commits after the update one: 736ac7a...next

please note, these changes are not backwards compatible.

The exported view properties now match the properties of the DFPBannerView.

I've now implemented the `validAdSizes` property, and replaced the `testDeviceID` property with `testDevices`. Also the simulator device id can be specified using `PublisherBanner.simulatorId` instead of `"EMULATOR"`.

The conversion of json to GADAdSize is now implemented using a RCTConvert category.

And lastly, the `loadBanner` method is now exposed to react, to allow easy banner refresh, and removes the need of checking which properties are available before making a request to admob.
this omits the need of explicit conversion
also, there are no nativeOnly events so removed those
instead of the mixed names like RNAdMobManager and BannerView they're all named like the implemented class, e.g. RNGADBannerView and RNGADBannerViewManager.
replaced deprecated RCTEventDispatcher with RCTEventEmitter
replaced deprecated RCTEventDispatcher with RCTEventEmitter
this is more or less the bare minimum, we should probably add some rules along the way
@koenpunt koenpunt merged commit a5dc629 into master Oct 3, 2017
@koenpunt koenpunt deleted the next branch October 12, 2017 13:12
@bebrandd
Copy link

bebrandd commented Apr 8, 2021

react-native-admob currently not work,
it was throw error in java file can not find symbol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants