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
GranifyConfiguration
instanceSince
5.3.0Declaration
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 be
nil
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
ofDeepLink
objects used to navigate within your app programmatically. -
Creates a
GranifyConfiguration
instanceDeclaration
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 be
nil
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
ofDeepLink
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 ofGranifyConfiguration
Declaration
Swift
public override var description: String { get }