Make sure to initiate Outbrain SDK by calling “register()” method with a partner key that is configured specifically for platforms (contact your AM or GTO for more details if needed). See example:
In order to generate a request for recommendations via the SDK, the app developer should create a new instance of
OBPlatformRequest with the following mandatory params:
- widget id
- bundleUrl or portalUrl
- lang (for example: “en”)
See the constructor signature
public OBPlatformRequest(String widgetId, String bundleUrl, String portalUrl, String lang)
OBPlatformRequest platformRequest = new OBPlatformRequest(OUTBRAIN_SAMPLE_WIDGET_ID, null, OUTBRAIN_SAMPLE_PORTAL_URL, "en");
Optional param – psub
psub is a property on
OBPlatformRequest which publishers can set for an additional source breakdown available for platforms.
There are 2 params needed for platforms API to support Outbrain News. The params are
news = "IAB1,IAB3,IAB10"
How to Set?
OBPlatformRequest platformRequest = new OBPlatformRequest("APP_31", null, "https://www.mi.com/", "en"); platformRequest.setNewsFrom("es"); platformRequest.setNews("IAB1,IAB3,IAB10"); Outbrain.fetchRecommendations(platformRequest, this);
OBPlatformRequest is created – the app developer can fetch recommendations by calling: