-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/cjc8/storekit #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| { | ||
| "identifier" : "3A04A699", | ||
| "nonRenewingSubscriptions" : [ | ||
|
|
||
| ], | ||
| "products" : [ | ||
|
|
||
| ], | ||
| "settings" : { | ||
|
|
||
| }, | ||
| "subscriptionGroups" : [ | ||
| { | ||
| "id" : "D4D7ADB7", | ||
| "localizations" : [ | ||
|
|
||
| ], | ||
| "name" : "Test Subscriptions", | ||
| "subscriptions" : [ | ||
| { | ||
| "adHocOffers" : [ | ||
|
|
||
| ], | ||
| "displayPrice" : "0.99", | ||
| "familyShareable" : false, | ||
| "groupNumber" : 1, | ||
| "internalID" : "5E311D41", | ||
| "introductoryOffer" : null, | ||
| "localizations" : [ | ||
| { | ||
| "description" : "This is a monthly subscription.", | ||
| "displayName" : "Monthly Subscription", | ||
| "locale" : "en_US" | ||
| } | ||
| ], | ||
| "productID" : "com.LUX.monthly", | ||
| "recurringSubscriptionPeriod" : "P1M", | ||
| "referenceName" : "Monthly Subscription", | ||
| "subscriptionGroupID" : "D4D7ADB7", | ||
| "type" : "RecurringSubscription" | ||
| }, | ||
| { | ||
| "adHocOffers" : [ | ||
|
|
||
| ], | ||
| "displayPrice" : "5.00", | ||
| "familyShareable" : false, | ||
| "groupNumber" : 1, | ||
| "internalID" : "CE003214", | ||
| "introductoryOffer" : null, | ||
| "localizations" : [ | ||
| { | ||
| "description" : "This is a 6 Month subscription.", | ||
| "displayName" : "6 Months Subscription", | ||
| "locale" : "en_US" | ||
| } | ||
| ], | ||
| "productID" : "com.LUX.biyearly", | ||
| "recurringSubscriptionPeriod" : "P6M", | ||
| "referenceName" : "BiYearly Subscription", | ||
| "subscriptionGroupID" : "D4D7ADB7", | ||
| "type" : "RecurringSubscription" | ||
| }, | ||
| { | ||
| "adHocOffers" : [ | ||
|
|
||
| ], | ||
| "displayPrice" : "9", | ||
| "familyShareable" : false, | ||
| "groupNumber" : 1, | ||
| "internalID" : "6F4B3CA8", | ||
| "introductoryOffer" : null, | ||
| "localizations" : [ | ||
| { | ||
| "description" : "This is a yearly subscription.", | ||
| "displayName" : "Yearly Subscription", | ||
| "locale" : "en_US" | ||
| } | ||
| ], | ||
| "productID" : "com.LUX.yearly", | ||
| "recurringSubscriptionPeriod" : "P1Y", | ||
| "referenceName" : "Yearly Subscription", | ||
| "subscriptionGroupID" : "D4D7ADB7", | ||
| "type" : "RecurringSubscription" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "version" : { | ||
| "major" : 1, | ||
| "minor" : 1 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import UIKit | ||
| import LUX | ||
| import PlaygroundVCHelpers | ||
| import FunNet | ||
| import PlaygroundSupport | ||
| import Slippers | ||
| import LithoOperators | ||
| import Prelude | ||
| import fuikit | ||
| import StoreKit | ||
|
|
||
| let vc = LUXSubscriptionViewController.makeFromXIB(name: "LUXSubscriptionViewController", bundle: Bundle(for: LUXSubscriptionViewController.self)) | ||
|
|
||
| struct StoreKitIdentifiers: Codable { | ||
| var identifiers: [String] | ||
| } | ||
|
|
||
| let call = CombineNetCall(configuration: ServerConfiguration(host: "lithobyte.co", apiRoute: "api/v1"), Endpoint()) | ||
| call.firingFunc = { call in | ||
| call.publisher.data = JsonProvider.encode(StoreKitIdentifiers(identifiers: ["com.LUX.monthly", "com.LUX.biyearly", "com.LUX.yearly"])) | ||
| } | ||
|
|
||
| let delegate = LUXSubscriptionDelegate() | ||
|
|
||
| vc.onViewDidLoad = { (vc: FUITableViewViewController) in | ||
| delegate.fetchProducts(from: call, unwrapper: ^\StoreKitIdentifiers.identifiers) | ||
| } | ||
| let vm = subscriptionViewModel(onTap: { print($0.localizedTitle) }, delegate: delegate) | ||
| vc.onViewDidAppear = { (vc: FUITableViewViewController, animated: Bool) in | ||
| vm.tableView = vc.tableView | ||
| vm.tableView?.reloadData() | ||
| vm.refresh() | ||
| } | ||
|
|
||
| PlaygroundPage.current.liveView = vc | ||
| PlaygroundPage.current.needsIndefiniteExecution = true | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For some reason I can't get the products to show up in the tableview, but I think that's because it's in a playground rather than a project. I'm having a hard time finding any help online (pretty niche situation) but i'll keep at it.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Playgrounds do have that issue – have you logged/messed with the view to make sure it's getting displayed? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
| <playground version='5.0' target-platform='ios' buildActiveScheme='true'> | ||
| <timeline fileName='timeline.xctimeline'/> | ||
| </playground> |
Uh oh!
There was an error while loading. Please reload this page.