diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b5b0bf..0009732 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ ## CHANGELOG +## [1.1.0] + +### Added + +- Purchase sale tracking API +- `DrawerControllerRepresentable` for story block to dismiss drawer +- Custom VAST attributes support +- In feed ad support + + ## [1.0.0] ### Added diff --git a/FireworkVideo.podspec b/FireworkVideo.podspec index a80c738..e640e5f 100644 --- a/FireworkVideo.podspec +++ b/FireworkVideo.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = "FireworkVideo" - spec.version = "1.0.1" + spec.version = "1.1.0" spec.summary = "FireworkVideoSDK" spec.homepage = "https://github.com/loopsocial/firework_ios_sdk" spec.license = { :text => "Copyright 2021 Loop Now Technologies, Inc.", :type => "Copyright" } diff --git a/FireworkVideoSample/FireworkVideoShoppingSample/View/CartViewController/CartViewController.swift b/FireworkVideoSample/FireworkVideoShoppingSample/View/CartViewController/CartViewController.swift index 4a3f3bc..f8922be 100644 --- a/FireworkVideoSample/FireworkVideoShoppingSample/View/CartViewController/CartViewController.swift +++ b/FireworkVideoSample/FireworkVideoShoppingSample/View/CartViewController/CartViewController.swift @@ -49,16 +49,37 @@ class CartViewController: UIViewController, CartViewRepresentable { } + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + if segue.identifier == "checkoutSegue" { + if let destinationVC = segue.destination as? CheckoutViewController { + destinationVC.drawerController = self.drawerController + } + } + } + @IBAction func handleCheckOutTap(_ sender: Any) { switch checkoutDisplayStyle { case .present: - guard let checkout = storyboard?.instantiateViewController(identifier: "CheckoutViewController") else { + guard let checkout = storyboard?.instantiateViewController(identifier: "CheckoutViewController") as? CheckoutViewController else { return } + checkout.drawerController = self.drawerController present(checkout, animated: true) case .push: performSegue(withIdentifier: "checkoutSegue", sender: self) } + + FireworkVideoSDK.trackPurchase( + orderID: UUID().uuidString, + value: Double.random(in: 1 ... 100), + currencyCode: Locale.current.currencyCode, + countryCode: Locale.current.regionCode, + [ + "additionalKey1": "additionalValue1", + "additionalKey2": "additionalValue2", + "additionalKey3": "additionalValue3" + ] + ) } } diff --git a/FireworkVideoSample/FireworkVideoShoppingSample/View/CheckoutViewController/CheckoutViewController.swift b/FireworkVideoSample/FireworkVideoShoppingSample/View/CheckoutViewController/CheckoutViewController.swift index d19e87c..f26b880 100644 --- a/FireworkVideoSample/FireworkVideoShoppingSample/View/CheckoutViewController/CheckoutViewController.swift +++ b/FireworkVideoSample/FireworkVideoShoppingSample/View/CheckoutViewController/CheckoutViewController.swift @@ -6,10 +6,12 @@ // import UIKit +import FireworkVideo class CheckoutViewController: UIViewController { private var shopping = ShoppingCartManager.shopifyInstance + var drawerController: DrawerControllerRepresentable? @IBOutlet weak var finishButton: UIButton! @@ -20,6 +22,7 @@ class CheckoutViewController: UIViewController { } @IBAction func handleFinishTap(_ sender: Any) { + self.drawerController?.closeDrawer(animated: true) self.dismiss(animated: true) } diff --git a/Package.swift b/Package.swift index 3bfb194..4328889 100644 --- a/Package.swift +++ b/Package.swift @@ -15,8 +15,8 @@ let package = Package( ], targets: [ .binaryTarget(name: "FireworkVideo", - url: "https://github.com/loopsocial/firework_ios_sdk/releases/download/v1.0.1/FireworkVideo-v1.0.1.xcframework.zip", - checksum: "f496b6b581521012b21e996d71441059a88b8a477b5f1d448e7ce50889ec9989"), + url: "https://github.com/loopsocial/firework_ios_sdk/releases/download/v1.1.0/FireworkVideo-v1.1.0.xcframework.zip", + checksum: "a590b0fd5ec6a9adde880d34d550ee361f365c4e8b57d32e3ebc828061dc2722"), ] ) diff --git a/README.md b/README.md index 759f431..6799cfd 100644 --- a/README.md +++ b/README.md @@ -475,6 +475,26 @@ If no provider is set the actions above will be replaced with these actions; res - User clicks cart icon - Nothing. - Host app returns `showEmbeddedCart` as the `AddToCartAction` - SDK treats this as a success and will use the `dismissWithFeedback` with `success`. +The `CartViewController` has a `drawerController: DrawerControllerRepresentable` property which provides a func to close the cart view container. + +#### Purchase tracking +The host app can record a purchase which will help get a full picture of the user journey flow.In order to do this, call `FireworkVideoSDK.trackPurchase` whenever the purchase happens. + +``` +let totalPurchaseValue: Double = // The total value of the purchase +FireworkVideoSDK.trackPurchase( + orderID: "", + value: totalPurchaseValue, + currencyCode: Locale.current.currencyCode, + countryCode: Locale.current.regionCode, + [ + "additionalKey1": "additionalValue1", + "additionalKey2": "additionalValue2", + "additionalKey3": "additionalValue3" + ] + ) +``` + ### Force Refresh A `VideoFeedViewController` can be hard refreshed by calling the `refresh()` method on the instance that should be refreshed. This functionality is useful if your feed is embedded along with other components that are also updated and you support features like pull to refresh.