FMX.Advertising.ICommonAd.CancelAction
Delphi
procedure CancelAction;
C++
virtual void __fastcall CancelAction() = 0 ;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | FMX.Advertising.pas FMX.Advertising.hpp |
FMX.Advertising | ICommonAd |
Description
Cancels the action of an advertisement and restores the interface of your application.
When a user taps an advertisement banner, the ad might maximize covering the full screen, open a web browser, or some other action that hides (totally or partially) your application. At any moment, if your application needs the user’s attention, you can call CancelAction to cancel the action of the advertisement and restore the interface of your application:
In Delphi:
procedure TForm1.NewMessageRequiresUsersAttention(Sender: TObject);
begin
if InstanceOfICommonAd.IsActionInProgress then
InstanceOfICommonAd.CancelAction;
end;
In C++:
void __fastcall TForm1::NewMessageRequiresUsersAttention(TObject *Sender)
{
if (InstanceOfICommonAd->IsActionInProgress())
InstanceOfICommonAd->CancelAction();
}
- Notes:
- This feature only works on ads from the iAd service (iOS). The AdMob service (Android) does not support this action.
- Using this action affects your revenue from advertisement. For more information, see the Apple documentation.