GranifyConfiguration

@objc(GFYGranifyConfiguration)
public class GranifyConfiguration : NSObject

The general configuration object used to gather all info to activate Granify

This object will tell Granify who you are (with forSite and optionally clientSiteId), and how we should navigate to various parts of your app. Many messages will need to direct the shopper to a different part of the app, particularly to specific product pages, but also to cart or even informational pages. This is how you tell Granify how to do that within your app.

See Configuring Granify for more details.

  • A block to build a deep link URL directly to a product or sku. The block takes a two arguments:

    1. The id of product item to link to
    2. Optionally, the specific sku, of that product, to link directly to, if applicable/possible

      Important

      No guarantees are made about which thread may invoke your provided callback. The main process thread or a different worker thread may be used.

      Since

      2.0.0

    Declaration

    Swift

    public typealias ProductLinkBuilderCallback = (String, String?) -> URL?
  • Creates a GranifyConfiguration instance

    Since

    5.3.0

    Declaration

    Swift

    @objc
    public init(forSite siteId: SiteIdentifier,
                childSiteId: SiteIdentifier? = nil,
                codeVersion: String? = nil,
                deepLinks: [DeepLink] = [])

    Parameters

    siteId

    The 5-character (alpha-numeric, case sensitive) site identifier provided to you by your account manager

    childSiteId

    The 5-character (alpha-numeric, case sensitive) site identifier for the child site. This should benil in most cases. The exceptions are installs with parent and child sites; usually when a shared top-level domain across stores exists.

    codeVersion

    The version string of your application code.

    deepLinks

    An Array of DeepLink objects used to navigate within your app programmatically.

  • Creates a GranifyConfiguration instance

    Declaration

    Swift

    @available(*, deprecated, message: "Do not pass a productLinkBuilder; provide a DeepLink with a linkFactory instead.")
    @objc
    public convenience init(forSite siteId: SiteIdentifier,
                            childSiteId: SiteIdentifier? = nil,
                            codeVersion: String? = nil,
                            deepLinks: [DeepLink] = [],
                            productLinkBuilder: ProductLinkBuilderCallback? = nil)

    Parameters

    siteId

    The 5-character (alpha-numeric, case sensitive) site identifier provided to you by your account manager

    childSiteId

    The 5-character (alpha-numeric, case sensitive) site identifier for the child site. This should benil in most cases. The exceptions are installs with parent and child sites; usually when a shared top-level domain across stores exists.

    deepLinks

    An Array of DeepLink objects used to navigate within your app programmatically.

    productLinkBuilder

    A block to build a deep link URL directly to a product or sku. Granify SDK strongly holds the provided block.

    Since

    2.0.0

  • Retrieves String representation of GranifyConfiguration

    Declaration

    Swift

    public override var description: String { get }