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

[TIMOB-24473] Android: Maintain API parity with iOS #66

Merged
merged 6 commits into from Nov 5, 2018

Conversation

garymathews
Copy link
Contributor

@garymathews garymathews commented Mar 10, 2017

  • Deprecate testing and publisherId
  • Implement adUnitId and adType
  • Use property variables in processProperties
  • Bump version to 4.1.0
TEST CASE
var win = Ti.UI.createWindow({backgroundColor: 'gray'}),
    admob = require('ti.admob'),
    view = admob.createView({
        top: 0,
        adBackgroundColor: 'red',
        adType : admob.AD_TYPE_BANNER,
        adUnitId : 'ca-app-pub-3283366778120745/7674974318'
    });

// test deprecation warning
view.setPublisherId('null');

win.add(view);
win.open();

JIRA Ticket

@hansemannn
Copy link
Contributor

@garymathews Is this ready to merge? I wanted to take a look if https://jira.appcelerator.org/browse/TIMOB-24550 is easy to implement.

@garymathews
Copy link
Contributor Author

@hansemannn Already part of this PR, set adType to AD_TYPE_INTERSTITIAL

prop_adSize = AdSize.BANNER;
break;
case AdmobModule.AD_TYPE_INTERSTITIAL:
prop_adSize = AdSize.FLUID;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you check with https://github.com/appcelerator-modules/ti.admob/pull/69/files and close mine instead? Wondering because I used an com.google.android.gms.ads.InterstitialAd instance, you specified a FLUID size.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Android doesn't have that: https://developers.google.com/android/reference/com/google/android/gms/ads/AdSize

AdSize.FLUID was the closest I could get

Copy link
Contributor

Choose a reason for hiding this comment

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

From what I understood, InterstitialAd is no size but a whole different type of ad. The above is the package-resolved class-name.

@Astrovic
Copy link
Sponsor Contributor

any news about this merge?

@ottopic
Copy link

ottopic commented Jun 25, 2018

Hello,
any news about Interstitial integration? Is this thread dead?

Thank you

@Astrovic
Copy link
Sponsor Contributor

On Android you can use this: https://github.com/Astrovic/titanium-admob/

@ottopic
Copy link

ottopic commented Jun 25, 2018

@Astrovic thank you.
I'll try to use both libraries to obtain the same result in iOS and Android.

@ottopic
Copy link

ottopic commented Nov 2, 2018

@ypbnv your push is a wonderfull news! I cannot wait to make test with this update! :) :D

Remove some duplications.
@ypbnv
Copy link
Contributor

ypbnv commented Nov 5, 2018

I have reworked the support for Interstitial ads a little bit - now it is a separate proxy with its own methods and shares events with the AdView. You can check out the documentation and the sample app.

The parity part of the PR is unchanged.

PS. The module version also got bumped to 4.4.0.

@garymathews If you can review the changes it will be awesome.

@garymathews
Copy link
Contributor Author

CR: PASS

@garymathews garymathews merged commit 6342686 into tidev:master Nov 5, 2018
@adampax
Copy link

adampax commented Dec 1, 2018

FYI I received the following error when attempting to run Android interstitial on an older project that didn't have run on main in thread enabled.

[ERROR] TiExceptionHandler: (main) [2006,14777] /index.js:126
[ERROR] TiExceptionHandler:     interstitialAd.load();
[ERROR] TiExceptionHandler:                 ^
[ERROR] TiExceptionHandler: Error: setAdListener must be called on the main UI thread.

Fix is to set this in tiapp.xml:
<property name="run-on-main-thread" type="bool">true</property>

Tested on 7.4.1.GA

@ypbnv
Copy link
Contributor

ypbnv commented Dec 3, 2018

@adampax Thank you for the feedback! You can check the status of the fix here:
https://jira.appcelerator.org/browse/MOD-2479

@adampax
Copy link

adampax commented Dec 3, 2018

You're welcome, and thanks @ypbnv for adding the android interstitials 👍

janvennemann pushed a commit that referenced this pull request Dec 6, 2018
[TIMOB-24473] Android: Maintain API parity with iOS
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.

None yet

6 participants