To run the example project, clone the repo, and run pod install
from the Example directory first.
- iOS 13 or later
- Your Vestico client id
VesticoKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'VesticoKit'
The sample app shows how VesticoKit can be used within an eCommerce app.
The first call to VesticoKit is to initialize the SDK with the shop credentials:
guard let vesticoInfoURL = Bundle.main.url(forResource: "VesticoSDKInfo", withExtension: "plist") else {
print("Cannot find Vestico SDK Info")
return false
}
VesticoKit.register(withConfigFileURL: vesticoInfoURL)
VesticoSDKInfo.plist
requires the following fields:
environmentURLPath
: URL to the Vestico environmentclientID
: A unique client id provided to you by VesticoapiKey
: A API key provided to you by Vestico
Send a request to the Vestico Integration Support team including the app bundle identifiers you wish to enable to retrieve your account details.
NOTE Vestico offers demo environments allowing you to try out the SDK.
VesticoKit.delegate = self
In your ViewController, you set the VesticoKit.delegate
to the View Controller to receive events from VesticoKitDelegate
public protocol VesticoKitDelegate {
func didReceiveButtonUpdate(forProductUID productUID: String, contentMatchEnabled: Bool, sizeRecommendationEnabled: Bool)
func didLoadProduct(withUID productUID: String)
}
Load products by passing the product id and widget type.
VesticoKit.configure(forProductUID: "<#productUID#>", presenting: <#vesticoWidgetType#>)
<#productUID#>
is the uid of the product in your shop<#vesticoWidgetType#>
is the type of widget you want to load. On PDPs this is usually.carousel
for the Vestico carousel
Record conversion events to understand your customers
VesticoKit.recordConversion(forOrderUID <#orderUID#>, items: <#items#>)
<#orderUID#>
is the order UID as String<#items#>
is an array ofOrderItem
objects
Vestico Ltd, info@vestico.co
VesticoKit is available under the GNU Lesser General Public License v3 (LGPL-3.0) license. See the LICENSE file for more info.