Skip to content

Commit

Permalink
Update SDK to v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
loopops committed Sep 7, 2022
1 parent d240a7e commit 78f6373
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 4 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion FireworkVideo.podspec
Original file line number Diff line number Diff line change
@@ -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" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
)
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
//

import UIKit
import FireworkVideo

class CheckoutViewController: UIViewController {

private var shopping = ShoppingCartManager.shopifyInstance
var drawerController: DrawerControllerRepresentable?

@IBOutlet weak var finishButton: UIButton!

Expand All @@ -20,6 +22,7 @@ class CheckoutViewController: UIViewController {
}

@IBAction func handleFinishTap(_ sender: Any) {
self.drawerController?.closeDrawer(animated: true)
self.dismiss(animated: true)
}

Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
]

)
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: "<Order ID of User Purchase>",
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.
Expand Down

0 comments on commit 78f6373

Please sign in to comment.