unit FMX. InterstitialAd. Android; interface uses System. SysUtils, System. Types, System. UITypes, System. Classes, System. Variants, FMX. Types, FMX. Controls, FMX. Forms, FMX. Graphics, FMX. Dialogs, Androidapi. JNI. AdMob, Androidapi. JNIBridge, Androidapi. JNI. JavaTypes, Androidapi. JNI. Widget, Androidapi. JNI. Location, Androidapi. JNI. App, Androidapi. JNI. Util, Androidapi. helpers, FMX. helpers. android, FMX. Platform. Android, Androidapi. JNI. Embarcadero, Androidapi. JNI. GraphicsContentViewText, FMX. Advertising, FMX. StdCtrls ; type TInterstitialAdListener = class private public procedure onAdClosed; cdecl; procedure onAdFailedToLoad ; cdecl; procedure onAdLeftApplication; cdecl; procedure onAdOpened; cdecl; procedure onAdLoaded; cdecl; end; TEventProc = procedure ; type TInterstitialAdvertisment = class private FTestMode : Boolean; procedure SetTestMode ; public FJAdRequest : JAdRequest; FJInterstitialAd : JInterstitialAd; RequestBuilder : JAdRequest_Builder; FAdUnitID : string; FInterstitialAdListener : TInterstitialAdListener; FEventOnAdClosed : TEventProc; FEventonAdFailedToLoad : TEventProc; FEventonAdLeftApplication : TEventProc; FEventonAdOpened : TEventProc; FEventononAdLoaded : TEventProc; constructor Create; procedure SetOnCloseEvent ; procedure SetOnAdFailedToLoad ; procedure SetOnAdLeftApplication ; procedure SetOnAdOpened ; procedure SetOnAdLoaded ; procedure InitAdvertisment; procedure setAdUnitId ; property TestMode : Boolean read FTestMode write SetTestMode; end; var AInterstitialAdvertisment : TInterstitialAdvertisment; implementation // Listener; procedure TInterstitialAdListener. onAdClosed; begin AInterstitialAdvertisment. FEventOnAdClosed ; end; procedure TInterstitialAdListener. onAdFailedToLoad ; begin AInterstitialAdvertisment. FEventonAdOpened('onAdFailedToLoad:OK:ErrorCode:'+IntToStr ; end; procedure TInterstitialAdListener. onAdLeftApplication; begin AInterstitialAdvertisment. FEventonAdOpened ; end; procedure TInterstitialAdListener. onAdOpened; begin AInterstitialAdvertisment. FEventonAdOpened ; end; procedure TInterstitialAdListener. onAdLoaded; begin AInterstitialAdvertisment. FEventononAdLoaded ; AInterstitialAdvertisment. FJInterstitialAd. show; end; //Component; constructor TInterstitialAdvertisment. Create; begin inherited Create; FTestMode := True; AInterstitialAdvertisment:=Self; end; procedure TInterstitialAdvertisment. setAdUnitId ; begin if AUnitID<>FAdUnitID then FAdUnitID := AUnitID; end; procedure TInterstitialAdvertisment. InitAdvertisment; begin CallInUIThread(procedure begin FJInterstitialAd := TJInterstitialAd. JavaClass. init ; FJInterstitialAd. setAdUnitId(StringToJString ; RequestBuilder := TJAdRequest_Builder. JavaClass. init ; if FTestMode = true then begin RequestBuilder. addTestDevice ; RequestBuilder. addTestDevice ; end; FJAdRequest := RequestBuilder. build; FInterstitialAdListener := TInterstitialAdListener. Create ; FJInterstitialAd. setAdListener(TJAdListenerAdapter. JavaClass. init ; FJInterstitialAd. loadAd ; end); end; procedure TInterstitialAdvertisment. SetTestMode ; begin FTestMode := AMode; end; procedure TInterstitialAdvertisment. SetOnCloseEvent ; begin FEventOnAdClosed := AProc; end; procedure TInterstitialAdvertisment. SetOnAdFailedToLoad ; begin FEventonAdFailedToLoad := AProc; end; procedure TInterstitialAdvertisment. SetOnAdLeftApplication ; begin FEventonAdLeftApplication := AProc; end; procedure TInterstitialAdvertisment. SetOnAdOpened ; begin FEventonAdOpened := AProc; end; procedure TInterstitialAdvertisment. SetOnAdLoaded ; begin FEventononAdLoaded := AProc; end; end. Ornek Uygulamahttp://ersanyakit.com/Interstitial. rar 🏴Hi'dan gelen varır Who'ya, Hi'da onun adıdır Who'da...

Nasıl Kullanılır? type TForm1 = class Button2: TButton; Memo1: TMemo; procedure Button2Click ; private public IAdvertisment : TInterstitialAdvertisment; end; var Form1: TForm1; implementation procedure onAdClosedEvent ; begin Form1. Memo1. Lines. add ; end; procedure onAdFailedToLoadEvent ; begin Form1. Memo1. Lines. add ; end; procedure onAdLeftApplicationEvent ; begin Form1. Memo1. Lines. add ; end; procedure onAdOpenedEvent ; begin Form1. Memo1. Lines. add ; end; procedure onAdLoadedEvent ; begin Form1. Memo1. Lines. add ; end; procedure TForm1. Button2Click ; begin IAdvertisment := TInterstitialAdvertisment. Create; IAdvertisment. SetOnCloseEvent ; IAdvertisment. SetOnAdFailedToLoad ; IAdvertisment. SetOnAdLeftApplication ; IAdvertisment. SetOnAdOpened ; IAdvertisment. SetOnAdLoaded ; IAdvertisment. TestMode := True; IAdvertisment. SetAdUnitID('ca-app-pub-1543398996171627/8995432791'); IAdvertisment. InitAdvertisment; end; 🏴Hi'dan gelen varır Who'ya, Hi'da onun adıdır Who'da...