Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions prebid-mobile/pbm-api/ios/pbm-targeting-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,26 @@ Pay attention that there are certain protected fields such as `regs`, `device`,
- App and User first party data should use the [functions defined for those purposes](/prebid-mobile/pbm-api/ios/pbm-targeting-ios.html#first-party-data)
- See the [Prebid Server auction endpoint](/prebid-server/endpoints/openrtb2/pbs-endpoint-auction.html#prebid-server-ortb2-extension-summary) reference for more information about how it will process incoming fields.

## ORTB Response Customization

Prebid SDK allows customizing the parsing of the of and the types used to represent the ORTB respnse. Use `CustomModelObjects.registerCustomType(_:)` to specify the custom types to use and override the `init(jsonDictionary:)` with custom parsing logic.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Prebid SDK allows customizing the parsing of the of and the types used to represent the ORTB respnse. Use `CustomModelObjects.registerCustomType(_:)` to specify the custom types to use and override the `init(jsonDictionary:)` with custom parsing logic.
Prebid SDK allows customizing the parsing of the types used to represent the ORTB response. Use `CustomModelObjects.registerCustomType(_:)` to specify the custom types to use and override the `init(jsonDictionary:)` with custom parsing logic.


``` swift
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
``` swift
```swift

class MyCustomORTBBidResponse: ORTBBidResponse {

var myCustomField: String?

required init(jsonDictionary: [String : Any]) {
myCustomField = jsonDictionary["customString"] as? String
super.init(jsonDictionary: jsonDictionary)
}
}

CustomModelObjects.registerCustomType(MyCustomORTBBidResponse.self)
```

You can use this to access custom or unsupported fields from the prebid response, or to modify the response at your own risk.

## Further Reading

- [Prebid Mobile Overview](/prebid-mobile/prebid-mobile.html)
Expand Down