{"action":"created","issue":{"url":"https://api.github.com/repos/floatinghotpot/cordova-admob-pro/issues/269","labels_url":"https://api.github.com/repos/floatinghotpot/cordova-admob-pro/issues/269/labels{/name}","comments_url":"https://api.github.com/repos/floatinghotpot/cordova-admob-pro/issues/269/comments","events_url":"https://api.github.com/repos/floatinghotpot/cordova-admob-pro/issues/269/events","html_url":"https://github.com/floatinghotpot/cordova-admob-pro/issues/269","id":121836069,"number":269,"title":"Ads Do Not Load - iOS (AdMob is undefined / sometimes)","user":{"login":"lreading","id":5851985,"avatar_url":"https://avatars.githubusercontent.com/u/5851985?v=3","gravatar_id":"","url":"https://api.github.com/users/lreading","html_url":"https://github.com/lreading","followers_url":"https://api.github.com/users/lreading/followers","following_url":"https://api.github.com/users/lreading/following{/other_user}","gists_url":"https://api.github.com/users/lreading/gists{/gist_id}","starred_url":"https://api.github.com/users/lreading/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lreading/subscriptions","organizations_url":"https://api.github.com/users/lreading/orgs","repos_url":"https://api.github.com/users/lreading/repos","events_url":"https://api.github.com/users/lreading/events{/privacy}","received_events_url":"https://api.github.com/users/lreading/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-12T06:03:35Z","updated_at":"2016-01-01T20:10:48Z","closed_at":null,"body":"Ads will not show up on iOS devices in my app.  I also sometimes get an \"AdMob is not defined\" error.  That is more than likely a phonegap/cordova/visual studio issue, as other plugins are not loaded correctly when that specific issue occurs. \r\n\r\nWhen AdMob is loaded correctly, when loading an interstitial, the success and failure callbacks are never executed, and the onAdLoaded and onAdFailed events are never fired either.  The device used for testing has a strong internet connection, and other internet connectivity in the application works as expected.\r\n\r\n*I have searched through all of the potentially related issues and have found that most of them relate to either bad installs using the CLI, or not including the cordova.js file in the html.  I have tried re-installing the plugin multiple times without success*\r\n\r\nEnvironment\r\n-\r\n - Visual Studio 2015 Community Edition (14.0.23107.0 D14REL)\r\n - Cordova CLI 5.4.0\r\n - iPod touch (running the app being built by phonegap build and also when debugging using the remote build feature connected to a mac mini)\r\n\r\nSteps To Reproduce\r\n- \r\n - Created a phone gap project using Visual Studio 2015 Community Edition\r\n - Install AdMob pro by going to the config.xml (gui) > plugins > custom > git > https://github.com/floatinghotpot/cordova-admob-pro\r\n - Verified that the following lines are in the config.xml source: `<plugin name=\"cordova-plugin-admobpro\" spec=\"2.9.9\" src=\"npm\" />`\r\n`<vs:plugin name=\"cordova-plugin-admobpro\" version=\"2.9.9\" src=\"https://github.com/floatinghotpot/cordova-admob-pro\" />`\r\n - Deploy to/debug on iOS device\r\n\r\nRelevant Code\r\n-\r\nThe following code is included in the onDeviceReady callback (except for mySuccess and myFailure functions which are defined beforehand), and I have included `<script src=\"cordova.js\"></script>` in my html file.\r\n\r\n        if (AdMob) {\r\n            document.addEventListener('onAdLoaded', function () {\r\n                isAdLoaded = true;\r\n            });\r\n\r\n            document.addEventListener('onAdFailLoad', function (data) {\r\n                console.error(\"Ad fail loaded.\");\r\n            });\r\n\r\n            // Prep the ad campaign\r\n            var admobid = {};\r\n\r\n            // select the right Ad Id according to platform\r\n            if (/(android)/i.test(navigator.userAgent)) {\r\n                admobid = {\r\n                    // for Android\r\n                    banner: '',\r\n                    interstitial: 'ca-app-pub-7132678996106473/3206955468'\r\n                };\r\n            } else if (/(ipod|iphone|ipad)/i.test(navigator.userAgent)) {\r\n                admobid = {\r\n                    // for iOS\r\n                    banner: 'ca-app-pub-7132678996106473/6160421869',\r\n                    interstitial: 'ca-app-pub-7132678996106473/6160421869'\r\n                };\r\n            } else {\r\n                admobid = {\r\n                    // for Windows Phone\r\n                    banner: '',\r\n                    interstitial: 'ca-app-pub-7132678996106473/9113888269'\r\n                };\r\n            }\r\n\r\n            var prepInterstitialOptions = {\r\n                adId: admobid.interstitial, \r\n                autoShow: false\r\n            };\r\n\r\n            AdMob.prepareInterstitial(prepInterstitialOptions, mySuccess, myFailure);`\r\n\r\n        } // end if admob\r\n\r\n\r\nI also tried creating a banner ad without success to see if it was specific to interstitials.\r\n\r\nThere are no other specific error messages or logging information that I am able to find at this time.\r\n\r\n\r\n\r\nAny help is greatly appreciated, and if there's information that I should have included, please let me know."},"comment":{"url":"https://api.github.com/repos/floatinghotpot/cordova-admob-pro/issues/comments/168335384","html_url":"https://github.com/floatinghotpot/cordova-admob-pro/issues/269#issuecomment-168335384","issue_url":"https://api.github.com/repos/floatinghotpot/cordova-admob-pro/issues/269","id":168335384,"user":{"login":"borninmusic","id":16511340,"avatar_url":"https://avatars.githubusercontent.com/u/16511340?v=3","gravatar_id":"","url":"https://api.github.com/users/borninmusic","html_url":"https://github.com/borninmusic","followers_url":"https://api.github.com/users/borninmusic/followers","following_url":"https://api.github.com/users/borninmusic/following{/other_user}","gists_url":"https://api.github.com/users/borninmusic/gists{/gist_id}","starred_url":"https://api.github.com/users/borninmusic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borninmusic/subscriptions","organizations_url":"https://api.github.com/users/borninmusic/orgs","repos_url":"https://api.github.com/users/borninmusic/repos","events_url":"https://api.github.com/users/borninmusic/events{/privacy}","received_events_url":"https://api.github.com/users/borninmusic/received_events","type":"User","site_admin":false},"created_at":"2016-01-01T20:10:48Z","updated_at":"2016-01-01T20:10:48Z","body":"Have barely the same issue: \r\n\r\nhttps://github.com/floatinghotpot/cordova-plugin-admob/issues/63\r\n\r\nNo luck for 3 days already."}}