Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
buskila
Visitor

Monthly subscription channel

I'm trying to create a subscription based channel. According to http://sdkdocs.roku.com/display/RokuSDKv48/Channel+Packaging+And+Publishing#ChannelPackagingAndPubli... you have to create two versions of your channel - one free and one paid. To upgrade from free to paid the free channel must call roChannelStore.DoUpgrade(). This sounds nice, however the method is not documented and calling it does nothing.

Anybody knows how to implement this scenario?

Thanks
--oleg
0 Kudos
13 REPLIES 13
RokuMarkn
Visitor

Re: Monthly subscription channel

I'm hoping to do a substantial update to the roChannelStore documentation soon. Meanwhile, note that DoUpgrade, like most of the roChannelStore methods, will not work in a side loaded channel. You need to run in a published channel (private is ok). So you must write your code, upload to the store, then download to your unit and test. It's admittedly rather awkward.

--Mark
0 Kudos
buskila
Visitor

Re: Monthly subscription channel

"RokuMarkn" wrote:
I'm hoping to do a substantial update to the roChannelStore documentation soon. Meanwhile, note that DoUpgrade, like most of the roChannelStore methods, will not work in a side loaded channel. You need to run in a published channel (private is ok). So you must write your code, upload to the store, then download to your unit and test. It's admittedly rather awkward.

--Mark


Seems straightforward enough. One question though - is there any way to bypass the actual payment? I do want to see that the "trial" channel gets replaced however.

Thanks
--oleg
0 Kudos
buskila
Visitor

Re: Monthly subscription channel

I tried calling DoUpgrade() for a non-sideloaded channel and it didnt work. Are there any logs or anything that can be seen?
0 Kudos
RokuMarkn
Visitor

Re: Monthly subscription channel

"buskila" wrote:

Seems straightforward enough. One question though - is there any way to bypass the actual payment? I do want to see that the "trial" channel gets replaced however.


In the developer web site, go to "Manage Test Users" and add the account you're using. Test user accounts can purchase your upgrade but won't be charged for it. Note that currently a given account can only make a purchase once. There's no way to "unbuy" the product after you've bought it.

--Mark
0 Kudos
MSGreg
Visitor

Re: Monthly subscription channel

Is "Manage Test Users" available only after acceptance into the Billing Service Program?
0 Kudos
RokuKevin
Visitor

Re: Monthly subscription channel

Yes. Your developer account must be approved for billing services to get the "Manage test users" link on your developer page.

--Kevin
0 Kudos
RokuMarkn
Visitor

Re: Monthly subscription channel

Ok, I've just done an upgrade and it works but there are few things to watch for. Both the pre-upgrade channel and the upgrade channel must come from the Channel Store (not sideloaded). For testing, both channels must be private channels, and both must be free, since a paid channel doesn't get into the store until approved. You can call roChannelStore.GetUpgrade() to verify that the store knows you have an upgrade. This returns an array containing one AA which contains info about the upgrade.

Here is the complete source of the pre-upgrade app I used.

function main() as Void
screen = CreateObject("roParagraphScreen")
msgport = CreateObject("roMessagePort")
screen.SetMessagePort(msgport)
screen.SetTitle("upgrade test")
screen.AddParagraph("calling GetUpgrade")
screen.Show()

store = CreateObject("roChannelStore")
store.SetMessagePort(msgport)
store.GetUpgrade()
items = invalid
while true
msg = wait(8000, msgport)
if msg = invalid then
exit while
elseif type(msg) = "roChannelStoreEvent" then
if msg.IsRequestSucceeded() then
items = msg.GetResponse()
print "got ";items.count();" items"
exit while
elseif msg.IsRequestFailed() then
print "channel store req failed: ";msg.GetStatusMessage()
return
end if
elseif type(msg) = "roParagraphScreenEvent" then
if msg.IsScreenClosed() then return
end if
end while
if items = invalid or items.count() < 1 then return
item = items[0]

facade = screen
screen = CreateObject("roParagraphScreen")
msgport = CreateObject("roMessagePort")
screen.SetMessagePort(msgport)
screen.SetTitle("upgrade test")
screen.AddParagraph("ready to upgrade to " + item.name + " (" + item.code + ")")
screen.AddButton(1, "Upgrade")
screen.Show()

store.SetMessagePort(msgport)
while true
msg = wait(0, msgport)
if type(msg) = "roParagraphScreenEvent" then
if msg.IsScreenClosed() then return
if msg.IsButtonPressed() then
print "starting upgrade"
if store.DoUpgrade() then
print "upgrade succeeded"
else
print "upgrade failed"
end if
end if
end if
end while
end function



--Mark
0 Kudos
RokuMarkn
Visitor

Re: Monthly subscription channel

Also, this is probably obvious but I should mention it -- the pre-upgrade channel must list the upgrade channel as its "In-Channel Upgrade" in the properties when the channel is created.

--Mark
0 Kudos
buskila
Visitor

Re: Monthly subscription channel

Apologies for the troubles, but its still not working
I have even created a test channel which only has the code you pasted above. The code is half working when side loaded (prints out "Order Failed" - i guess because its side loaded), but when trying to download the channel, during installation it says "downloaded but could not be installed"

--oleg
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.