Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
gearheads
Level 7

Single Channel Store Instance in a Task

I am using code from the Roku Billing Sample  to implement in-app purchasing. When I run the billing task in my app, I get a warning about:

BRIGHTSCRIPT: WARNING: clDoOrder: GetCatalog must be called on the same roChannelStoreObject before calling DoOrder

In the documentation for roChannelStore it mentions having only one instance of ChannelStore instantiated during the purchase flow. Looking at the RokuBillingTask from the sample code, a new channel store is created each time the task is run. So it creates a new ChannelStore instance when you call GetProducts and then it creates another ChannelStore instance when you call PurchaseProduct. This means multiple instances of the ChannelStore are created and we get the above error.

So how does Roku suggest using the ChannelStore and tasks in a way that works with the restriction of having only one instance of a ChannelStore?
0 Kudos
2 Replies
Roku Employee
Roku Employee

Re: Single Channel Store Instance in a Task

"gearheads" wrote:
...So how does Roku suggest using the ChannelStore and tasks in a way that works with the restriction of having only one instance of a ChannelStore?


Possibly https://blog.roku.com/developer/channel ... ling-guide will help?

I believe for an RSG app you want to use the ChannelStore node (https://sdkdocs.roku.com/display/sdkdoc/ChannelStore), not roChannelStore.
0 Kudos
gearheads
Level 7

Re: Single Channel Store Instance in a Task

Using the ChannelStore node works now. I was following the sample code on https://sdkdocs.roku.com/display/sdkdoc ... Purchasing which still uses the roChannelStore object and a Task. That page should probably be updated to use the more recent sample code.
0 Kudos