將 TestMode 屬性勾選為 True
procedure Tform1.FormCreate(Sender: TObject); begin adMob.AdUnitID := 'ca-app-pub-xxxxxxxxxxxxxxxx/yyyyyyyyyy'; end;
編輯 AndroidManifest.template
<meta-data android:name="com.google.android.gms.version" android:value="4323000"/> <activity android:name="com.embarcadero.firemonkey.FMXNativeActivity" ... ... </activity> <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
點擊功能表 "Project" ==> "Options..."
勾選 "Uses Permissions" 的 "Access network state" 和 "Internet"
procedure Tform1.FormShow(Sender: TObject); begin adMob.LoadAd; end;
沒有留言:
張貼留言