Skip to main content

Google PAL

The FLAdvertisingGooglePAL library integrates with Google PAL library to enable publishers make a direct call to monetize iOS & tvOS Applications.

Supported GooglePAL SDK version

  • iOS 2.5.2
  • tvOS 2.5.2

Create Configuration

Create a PALSessionConfiguration with the configuration which is needed. The following snippet shows configuration creation with sample configuration values.

let palConfig = FLPALFactory.palConfiguration(willAdAutoPlay: .on,
descriptionUrl: contentUrl,
nonceLengthLimit: 3000,
playerVersion: FLPlayer.version(),
ppid: "some id",
omidPartnerName: "Appname",
omidPartnerVersion: Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "1.0",
omidVersion: [OMIDSDK versionString])

Create PAL Session

Create a PALSession for every playback. The events for the playback can be captured through this session.

let session = FLPALFactory.palSession()

Get Nonce

In order to get the Nonce from Google PAL you need to call the method initialize from the PALSession instance, and the callback function that will be used to return the value of Nonce once Google PAL returns it.

palSession.initialize(palConfig: palConfig, completion: { result in
switch result {
case let .success(nonce):
print("Google Pal nonce: \(nonce)")
case let .failure(error):
print("Error generating nonce: \(error)")
}
})

Session Events

Trigger the following events to notify the playback events to PALSession

Send Playback Start

In order to notify to Google server that playback is started you need to call the method sendPlaybackStart without any parameters.

palSession.sendPlaybackStart()

Send Playback End

In order to notify to Google server that playback is ended you need to call the method sendPlaybackEnd without any parameters.

palSession.sendPlaybackEnd()

Send Click

In order to notify to Google server that ad playback is clicked you need to call the method sendClick without any parameters.

palSession.sendClick()

Shutdown Session

Shutdown the PALSession on playback end.

palSession.shutdown()