AdMob with Ionic 2
<p>I am using Ionic 2.</p>

<blockquote>
<pre><code>Your system information:

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.0.0-beta.20
OS:
Node Version: v6.2.2
</code></pre>
</blockquote>

<p>I have just installed the Cordova plugin <a href="https://github.com/floatinghotpot/cordova-admob-pro" rel="nofollow noreferrer">cordova-admob-pro</a>:</p>

<pre><code>cordova plugin add cordova-plugin-admobpro
</code></pre>

<p>Then as per their instructions, I add the following code:</p>

<p><strong>app.ts</strong></p>

<pre><code>import { AdMob } from 'ionic-native';
....
if (AdMob) AdMob.createBanner({
  adId: admobid.banner,
  position: AdMob.AD_POSITION.BOTTOM_CENTER,
  isTesting: true,//comment this out before publishing the app
  autoShow: true
});
</code></pre>

<p>But, I get the following error:</p>

<blockquote>
<pre><code>ERROR in ./app/app.ts
(138,23): error TS2339: Property 'AD_POSITION' does not exist on type 'typeof AdMob'.
</code></pre>
</blockquote>

<p>When I follow the imported code, <code>AdMob</code> is defined in <code>admob.d.ts</code> in the plugin, but it doesn't have a <code>AD_POSITION</code>:</p>

<p><strong>admob.d.ts</strong></p>

<pre><code>...
export declare class AdMob {
...
</code></pre>

<p>If anyone can advise what I am doing wrong, and how I can get a handle on <code>AD_POSITION</code>, I would appreciate it.</p>

<p>Thanks</p>

<p><strong>UPDATE</strong></p>

<p>The problem is because the <code>Admob</code> in <code>ionic-native</code> does not have <code>AD_POSITION</code>, however, if I remove the import from <code>ionic-native</code>, I get:</p>

<blockquote>
<pre><code>ERROR in ./app/app.ts
(136,9): error TS2304: Cannot find name 'AdMob'.
</code></pre>
</blockquote>

<p>I see that <code>AD_POSITION</code> is in <code>plugins\cordova-plugin-admobpro\typescript\AdMob.d.ts</code>. So I gather, this is the one I should be using.  But how do I import this one?</p>

<p><strong>UPDATE</strong></p>

<p>This may be the problem. I am just testing it.</p>

<p><a href="https://i.stack.imgur.com/KzhbJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KzhbJ.png" alt="enter image description here"></a></p>

<p><strong>UPDATE</strong></p>

<p>This is what I now have, but I still get the error below:</p>

<p><a href="https://i.stack.imgur.com/XYwp1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XYwp1.png" alt="enter image description here"></a></p>

<blockquote>
<pre><code>ERROR in ./app/app.ts
(136,9): error TS2304: Cannot find name 'AdMob'.
</code></pre>
</blockquote>

<p>So my problem is that I don't know how to import the '<code>AdMob</code>' from the plugin.</p>