Skip to main content

Troubleshooting

Intro

There are several implementation types and use cases of the Outbrain Android SDK. This page describes common implementation issues and possible solutions for them. This page is intended for app developers that are having issues with the SDK implementation. It is recommended to follow this guide before contacting the Outbrain Inc. representative. If you're encounter issues that are not described in this document please reach out to your Outbrain representative and describe the issue.

info

Before jumping into the possible issues and solutions it is always a good practice to make sure to update to the latest SDK version and follow the implementation guidelines.

Common issue - Viewability

Please note, the viewability is being reported when at least 50% of a recommendation is on the screen for at least 1 second.

Bridge use case

Bridge use case is used to show multiple recommendation cards in a feed format below article content embedded in a scroll type of layout. Bridge implementation is called SFWidget.

Storyboard / XIB Layout issues

In the Storyboard / XIB layout it is possible to implement the SFWidget in a few different ways (please refer to our sample apps for examples).

Viewability not reported

If the viewability of the SFWidget is not reported please make sure to implement the scrollViewDidScroll method described here. Please note, since SDK version 5.2.0 this is not needed and if you are using this or later version of the SDK and still encounter the viewability not reported issue please contact the Outbrain representative.

Widget height is incorrect

In some cases the widget height seems to be incorrect and the widget is being cut off. In this case the widget container view or the widget itself (depending on the specific implementation details) should have a height constraint. The height constraint value should be updated by implementing the SFWidgetDelegate didChangeHeight method like described here. Please note, if you are adding the SFWidget to the view hierarchy programmatically the translatesAutoresizingMaskIntoConstraints property should be set to false in case you are using the NSLayoutConstraint for layout.

SwiftUI issues

SwiftUI implementation of the SFWidget requires wrapping it in the UIViewRepresentable. For explanation and sample code please refer to the implementation guidelines. There are currently (SDK version 5.2.0 and later) no known issues with the SwiftUI implementation type. If you experience any issues with the SwiftUI implementation please reach out to the Outbrain representative.

Regular SDK use case

Regular SDK use case is when publisher requests the recommendations from the Outbrain backend and renders it on the application side in their own UI.

Storyboard / XIB Layout issues

Viewability not reported

In case of Interface Builder implementation for Regular SDK it is required to call the Outbrain.configureViewabilityPerListing(for: contentView, withRec: rec) method in order to track the viewability. This method should be called for each recommendation that is being displayed on the screen. For more information please refer to the implementation guidelines.

SwiftUI issues

Viewability not reported

For SwiftUI framework we have a custom ViewModifier that is handling the viewability. For each recommendation view please add a .addViewability(with: recommendation) modifier.