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

feat(ios): swift rewrite and API changes #86

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

janvennemann
Copy link
Contributor

@janvennemann janvennemann commented Feb 20, 2019

Complete module rewrite using Swift. This will introduce breaking changes in terms of SDK compatibility as well as API changes. It's currently work in progress but i already want to use this PR to discuss the API changes.

I created new docs under https://github.com/janvennemann/ti.admob/tree/MOD-2495/docs which represent the current state of the iOS API with Swift. There is a doc for each proxy containing detailed API references and parity info at the bottom. The main changes that i would propose for this module would be:

Module

Changes

  • New method initialize to initialize the Google Ads SDK
  • New method createBannerView to create banner views. I think this one is currently called createView in Android.
  • New constants AD_SIZE_* to be able to specify different banner sizes.

Parity notes

Banner view proxy

Changes

  • Ad will now be loaded via load and options can be passed for each load request.
  • Ad size can be specified via the new AdSize proxy.
  • Renamed events to be more JS'ish BREAKING CHANGE

Parity notes

  • Android: loadAd and requestAd can be replaced by load
  • Android: All properties except for adUnitId and adSize can be removed. Ad request customization is done via load(options).

The only breaking change so far on Android would be the event renaming. However this can be avoided if we internally map the old event names to the new ones. The old methods can just be deprecated and the new ones introduced alongside them.

cc @ypbnv

@janvennemann janvennemann changed the title refactor(ios): swift rewrite chore: swift rewrite and API changes Feb 20, 2019
@janvennemann
Copy link
Contributor Author

The build is currently failing because i had to remove the Google ad framework because it exceeds GitHubs files limit in the newest version. We have to come up with a different way to integrate it in CI builds. For local builds it can just be downloaded manually.

@janvennemann
Copy link
Contributor Author

janvennemann commented Feb 22, 2019

@ypbnv added the insterstital ad implementation.

Parity notes

  • load supports options to customize the ad request.
  • adUnitId is a property without getter/setter
  • Event names are the same as for the banner view. The Android docs state that there is an additional AD_CLICKED event but i couldn't find that in the source.

@Astrovic
Copy link
Contributor

All ads formats will support the extras property, for example to pass extras : {'npa': '1'} to disable personalized ads (GDPR)?

@janvennemann
Copy link
Contributor Author

@Astrovic, yes that's accounted for in the API changes. Every add will have a load(options) method that allows to pass extras among other add request customization.

@Astrovic
Copy link
Contributor

Thanks @janvennemann I have just seen the documentation, really a great job!

@janvennemann janvennemann changed the title chore: swift rewrite and API changes feat(ios): swift rewrite and API changes Jun 19, 2019
@janvennemann
Copy link
Contributor Author

@vijaysingh-axway Can you take a look at this? Thanks!

@build
Copy link

build commented May 12, 2020

Fails
🚫 version bump was Major in ios/manifest but Patch in package.json
Warnings
⚠️

🔍 Can't find junit reports at ./TESTS-*.xml, skipping generating JUnit Report.

Messages
📖

💾 Here are the artifacts produced:

📖 🎉 - congrats on your new release

Generated by 🚫 dangerJS against b8d4f1d

* fix(ios): removed/replaced depreciated methods

* fix(ios): moved testDeviceIdentifiers & setTagForChildDirectedTreatment to admob module

* doc: fix docs

Co-authored-by: Vikas Goyal <38314488+vikas-goyal-syncplicity@users.noreply.github.com>
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.

4 participants