Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2327] Android: Ti.Admob - Ad not received on 6.0.2.GA with latest Admob 3.0.1

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAdmob
Labelsn/a
ReporterIshan Singh
AssigneeGary Mathews
Created2017-03-05T17:56:25.000+0000
Updated2017-03-10T15:12:13.000+0000

Description

[INFO] : Ads: Starting ad request. [WARN] : Ads: There was a problem getting an ad response. ErrorCode: 1 Gogle play services not found

Attachments

FileDateSize
admob.png2017-03-09T15:38:16.000+000094452

Comments

  1. Ishan Singh 2017-03-06

    Hi, Please provide a proper documentation, as in the latest git repo code doc there is a property called debugEnabled, but in the actual code its checking for property testing in the dict passed from appcelerator. Also Please show a working demo for android. For iOs everything works fine Below is the code i am using Osx El captain, tisdk 6+ , appc studio version 4.8
       var Admob = require('ti.admob');
       
       var bannerAdd = Admob.createView({
       	height : 50,
       	width : 320,
       	bottom : 40,
       	debugEnabled : false,
       	adType : Admob.AD_TYPE_BANNER,
       	adUnitId : 'ca-app-pub-3283366778120745/7674974318',
       	adBackgroundColor : '#7C181C',
       	estDevices : ['1CBA2C2A43588EB806AB1E74AD093760'], // You can get your device's id by looking in the console log
       	contentURL : 'https://www.google.com', // URL string for a webpage whose content matches the app content.
       	requestAgent : 'Titanium Mobile App', // String that identifies the ad request's origin.
       	extras : {
       		'version' : 1.0,
       		'name' : 'App'
       	},
       	publisherId : 'pub-3283366778120745',
       	tagForChildDirectedTreatment : false, // http:///business.ftc.gov/privacy-and-security/childrens-privacy for more infos
       });
       
       bannerAdd.addEventListener('didReceiveAd', function() {
       	Alloy.Globals.MotivationRadioNameSpace.printLogs('Did receive ad!');
       });
       bannerAdd.addEventListener('didFailToReceiveAd', function(e) {
       	Alloy.Globals.MotivationRadioNameSpace.printLogs('Failed to receive ad: ' + e.error);
       });
       bannerAdd.addEventListener('willPresentScreen', function() {
       	Alloy.Globals.MotivationRadioNameSpace.printLogs('Presenting screen!');
       });
       bannerAdd.addEventListener('willDismissScreen', function() {
       	Alloy.Globals.MotivationRadioNameSpace.printLogs('Dismissing screen!');
       });
       bannerAdd.addEventListener('didDismissScreen', function() {
       	Alloy.Globals.MotivationRadioNameSpace.printLogs('Dismissed screen!');
       });
       bannerAdd.addEventListener('willLeaveApplication', function() {
       	Alloy.Globals.MotivationRadioNameSpace.printLogs('Leaving the app!');
       });
       bannerAdd.addEventListener('didReceiveInAppPurchase', function(e) {
       	Alloy.Globals.MotivationRadioNameSpace.printLogs('Did receive an inApp purchase!');
       	Ti.API.warn(e);
       });
       $.mainWin.addEventListener('click', function(e) {
       	bannerAdd.requestAd();
       });
       
  2. Gary Mathews 2017-03-09

    [~ishansingh2003] Using ti.admob 3.0.1 I'm able to display a test banner using the code below:
       var win = Ti.UI.createWindow(),
           admob = require('ti.admob'),
           view = admob.createView({
               top: 0,
               adBackgroundColor: 'red',
               testing: true,
               publisherId: 'ca-app-pub-3940256099942544/6300978111'
           });
       win.add(view);
       win.open();
       
    !admob.png|thumbnail!
  3. Ishan Singh 2017-03-09

    Hi garry, I downloaded the latest compiled module from github. So that was not working. Then I downloaded the code and i saw that there are blunder mistakes in the code. I changed few stuff and it started working. I don't know from where you have your module compiled. If you see the code on github its passing publisherid In the setAddUnitId method in native, that's why it was not showing so when i changed it to Ad unit id it started working. Will be committing latest Code there. If you can have a look that will be great
  4. Ishan Singh 2017-03-09

    See you too are passing adunitid into publishers id.

JSON Source