Skip to content

Commit

Permalink
feat(cordova/ios): add contentUrl, keywords ad options
Browse files Browse the repository at this point in the history
  • Loading branch information
ratson committed Jul 8, 2021
1 parent c2bb6f1 commit 08a1d3f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/capacitor/ios/Plugin/AMBCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ extension AMBCoreContext {
if let contentURL = optString("contentUrl") {
request.contentURL = contentURL
}
if let keywords = optStringArray("keywords") {
request.keywords = keywords
}
let extras = GADExtras()
if let npa = optString("npa") {
extras.additionalParameters = ["npa": npa]
Expand Down
3 changes: 3 additions & 0 deletions packages/cordova/src/ios/AMBCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ extension AMBCoreContext {
if let contentURL = optString("contentUrl") {
request.contentURL = contentURL
}
if let keywords = optStringArray("keywords") {
request.keywords = keywords
}
let extras = GADExtras()
if let npa = optString("npa") {
extras.additionalParameters = ["npa": npa]
Expand Down
8 changes: 7 additions & 1 deletion packages/cordova/ts/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import { execAsync, NativeActions } from './generated'
export { execAsync, AdSizeType, Events, NativeActions } from './generated'

/** @internal */
export type MobileAdOptions = { id?: number; adUnitId: string; npa?: '1' }
export type MobileAdOptions = {
id?: number
adUnitId: string
contentUrl?: string
keywords?: string[]
npa?: '1'
}

/** @internal */
export class MobileAd<T extends MobileAdOptions = MobileAdOptions> {
Expand Down
3 changes: 3 additions & 0 deletions packages/react-native/ios/AMBCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ extension AMBCoreContext {
if let contentURL = optString("contentUrl") {
request.contentURL = contentURL
}
if let keywords = optStringArray("keywords") {
request.keywords = keywords
}
let extras = GADExtras()
if let npa = optString("npa") {
extras.additionalParameters = ["npa": npa]
Expand Down

0 comments on commit 08a1d3f

Please sign in to comment.