Skip to main content

Overriding Click Handler

info

NDA Module - Describes the feature that can override the click processing regarding Server to Server (hereinafter referred to as S2S) advertisements.

Override click handling settings

Landing processing settings can be separately set through the GFPAdConfiguration property or ad loader settings.

If both the configuration and loader for each ad type are set to S2SClickDelegate, it will be prioritized as follows:

  1. S2SClickDelegate set in each ad type loader
  2. S2SClickDelegate set globally in GFPAdConfiguration

If neither of them is set, the default setting will be used when landing.

warning

When implementing the handler, the call is mandatory for whether the click was processed appropriately through GFPS2SAdLandingHandler which was passed as an argument. Billing occurs only when the exact value is provided, so please make sure to double-check. The handler must be called within the openURL() method scope.

ex) If an attempt to open was made without waiting for a response from UIApplication.shared.open, landingHandler(true) will be called immediately.

Global settings through GFPAdConfiguration when initializing SDK

    var configuration = GFPAdConfiguration()
configuration.s2sClickDelegate = self;

GFPAdManager.setup(withPublisherCd: "", target:self, configuration: configuration) { error:GFPError? in
...
}
    func openURL(with urlString: String!, landingHandler: GFPS2SAdLandingHandler!) {

let landingUrl = GFPURLUtils.url(with: urlString)
let isClickProcessEnable = UIApplication.sharedApplication.canOpenURL(landingUrl)

UIApplication.shared.open(landingUrl, options: [:]) { isSuccess in
...
}

...

if (landingHandler != nil) {
landingHandler(isClickProcessEnable);
}
}

Loader setting for each ad type

GFPAdLoader

    var adLoader:GFPAdLoader;
...
adLoader.s2sClickDelegate = self;
    func openURL(with urlString: String!, landingHandler: GFPS2SAdLandingHandler!) {
UIApplication.shared.open(GFPURLUtils.url(with: urlString), options: [:]) { isSuccess in
if (landingHandler != nil) {
landingHandler(isSuccess);
}
}
}

GFPBannerView

    var bannerView:GFPBannerView;
...
bannerView.s2sClickDelegate = self;
    func openURL(with urlString: String!, landingHandler: GFPS2SAdLandingHandler!) {
UIApplication.shared.open(GFPURLUtils.url(with: urlString), options: [:]) { isSuccess in
if (landingHandler != nil) {
landingHandler(isSuccess);
}
}
}

GFPVideoAdManager

    var videoAdManager:GFPVideoAdManager;
...
videoAdManager.s2sClickDelegate = self;
    func openURL(with urlString: String!, landingHandler: GFPS2SAdLandingHandler!) {
UIApplication.shared.open(GFPURLUtils.url(with: urlString), options: [:]) { isSuccess in
if (landingHandler != nil) {
landingHandler(isSuccess);
}
}
}

GFPVideoAdScheduleManager

    var videoAdScheduleManager:GFPVideoAdScheduleManager;
...
videoAdScheduleManager.s2sClickDelegate = self;
    func openURL(with urlString: String!, landingHandler: GFPS2SAdLandingHandler!) {
UIApplication.shared.open(GFPURLUtils.url(with: urlString), options: [:]) { isSuccess in
if (landingHandler != nil) {
landingHandler(isSuccess);
}
}
}

GFPRewardedAdManager

    var rewardedAdManager:GFPRewardedAdManager;
...
rewardedAdManager.s2sClickDelegate = self;
    func openURL(with urlString: String!, landingHandler: GFPS2SAdLandingHandler!) {
UIApplication.shared.open(GFPURLUtils.url(with: urlString), options: [:]) { isSuccess in
if (landingHandler != nil) {
landingHandler(isSuccess);
}
}
}