Test inline campaigns (iOS)

This section describes how to validate your integration by forcing inline campaigns to appear in specific locations, ensuring that the component's expansion and collapse behavior does not interfere with your existing UI layouts. 

Note: Test GranifyInlineViewand GranifyInlineSwiftUIView extensively because they are embedded in the UI.  

Test with overrides

You can test inline campaigns manually using the Granify.overrideGranifyInlineView(label:) function. This function accepts a JSON object that specifies the details of a GranifyInlineViewLabel. Refer to the following example JSON objects for a product page or cart page.

Product page:

JSON
[JSON] { "name": "aboveProductPageProductPhoto", "product_id": <product id> }

Cart page inline associated with product:

JSON
[JSON] { "name": "bottomOfListedProduct", "product_id": <cart product id>, "sku": <cart product sku>}

Inline not associated with a product:

JSON
[JSON] { "name": "aboveCartPageTotal"}

You should also:

  • Implement a text box within your app's internal debug menu that accepts these JSON strings and passes them to Granify.overrideGranifyInlineView(label:). 

  • Use the override function with Granify.showConcept(conceptId:) to display a specific campaign creative within your desired GranifyInlineView.

Inline views are not hidden when a restricted state is set. They will persist and remain visible regardless of the current restricted state configuration.

Troubleshooting

If you are using Interface Builder to change a UIView to a custom class and GranifyInlineView results in GranifyInlineView not being found, do the following:

Use GFYGranifyInlineView instead of GranifyInlineView in the Custom Class > Class field in Interface Builder to avoid this error. 

Provide feedback button