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.
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 desiredGranifyInlineView.
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.