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:
- The id of product item to link to
- 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
GranifyConfigurationinstanceSince
5.3.0Declaration
Swift
@objc public init(forSite siteId: SiteIdentifier, childSiteId: SiteIdentifier? = nil, codeVersion: String? = nil, deepLinks: [DeepLink] = [])Parameters
siteIdThe 5-character (alpha-numeric, case sensitive) site identifier provided to you by your account manager
childSiteIdThe 5-character (alpha-numeric, case sensitive) site identifier for the child site. This should be
nilin most cases. The exceptions are installs with parent and child sites; usually when a shared top-level domain across stores exists.codeVersionThe version string of your application code.
deepLinksAn
ArrayofDeepLinkobjects used to navigate within your app programmatically. -
Creates a
GranifyConfigurationinstanceDeclaration
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
siteIdThe 5-character (alpha-numeric, case sensitive) site identifier provided to you by your account manager
childSiteIdThe 5-character (alpha-numeric, case sensitive) site identifier for the child site. This should be
nilin most cases. The exceptions are installs with parent and child sites; usually when a shared top-level domain across stores exists.deepLinksAn
ArrayofDeepLinkobjects used to navigate within your app programmatically.productLinkBuilderA 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
Stringrepresentation ofGranifyConfigurationDeclaration
Swift
public override var description: String { get }
GranifyConfiguration Class Reference