basitnizami
9 years agoVisitor
In-Channel Monthly / Annual Subscription issue in Roku / Bright Script
Good Day Everyone!
I have gone through all of the documentation stuff and have read about the "roChannelStore" component that can be used for in-channel purchases or subscriptions. I have also read about the "Fake Server" approach for local development (side-loading) and how it uses the xml files as the server calls instead of actually talking to roku server when we do "store.FakeServer(true)" where "store" is an instance of "roChannelStore".
My Scenario
I have an application that shows a video thumbnail and when I click on it, it shows a button to "Play" using Label List. Clicking that button plays the video at the moment.
My Requirement
I want to check if the current user is subscribed to the video shown and only then show the "Play" button. I can do this by fetching the subscribed products using "GetPurchases()" function and then checking if the product is inside that collection. Otherwise show two buttons. One for monthly subscription price and the other for annual subscription price that I can use to trigger the Order Placement.
The Problem
The way I see it, a product can be set as either Consumable, NonConsumable or MonthlySub in that xml file. Is that possible for a single product that I can choose if I want either monthly subscription or annual? How to handle this scenario? I cannot figure out how to allow both monthly and annual subscription types link to one product and then trigger that specific subscription from my code.
The xml file I'm talking about is the "GetCatalog.xml" file, provided in the "csfake" folder in the sample project that I downloaded from https://blog.roku.com/developer/2013/06/06/supporting-in-app-purchases-in-your-roku-brightscript-channels/ (download link in the end)
Any help or pointer would be really appreciated.
I have gone through all of the documentation stuff and have read about the "roChannelStore" component that can be used for in-channel purchases or subscriptions. I have also read about the "Fake Server" approach for local development (side-loading) and how it uses the xml files as the server calls instead of actually talking to roku server when we do "store.FakeServer(true)" where "store" is an instance of "roChannelStore".
My Scenario
I have an application that shows a video thumbnail and when I click on it, it shows a button to "Play" using Label List. Clicking that button plays the video at the moment.
My Requirement
I want to check if the current user is subscribed to the video shown and only then show the "Play" button. I can do this by fetching the subscribed products using "GetPurchases()" function and then checking if the product is inside that collection. Otherwise show two buttons. One for monthly subscription price and the other for annual subscription price that I can use to trigger the Order Placement.
The Problem
The way I see it, a product can be set as either Consumable, NonConsumable or MonthlySub in that xml file. Is that possible for a single product that I can choose if I want either monthly subscription or annual? How to handle this scenario? I cannot figure out how to allow both monthly and annual subscription types link to one product and then trigger that specific subscription from my code.
The xml file I'm talking about is the "GetCatalog.xml" file, provided in the "csfake" folder in the sample project that I downloaded from https://blog.roku.com/developer/2013/06/06/supporting-in-app-purchases-in-your-roku-brightscript-channels/ (download link in the end)
Any help or pointer would be really appreciated.