Used the Deep Linking template to create a monthly subscription channel and created test users and test products which worked fine as a sideloaded channel. Everything worked fine in test by allowing signup to subscription. Checked the appropriate boxes in channel submission for publishing but after being published the option doesn't come up on videos as they did when in test stage. Nothing was changed other than publishing the channel. What are we missing? Thanks!
The channel name is Street Credit TV and the channel ID I believe is "6d4bd5be36c92c1d8f573ee133b87b26" since my channel URL is https://channelstore.roku.com/details/6d4bd5be36c92c1d8f573ee133b87b26/
Thanks for the reply!
The proper way I make sure my billing code is working as well as the associated products or subscriptions is to write the channel as it will be in its final form, with no billing "testing" code, fake store, etc. It needs to be the actual package you plan to publish. Create another channel on the site with a different name, something like "My Channel TEST". Upload the package and enter any details required to just get you by for testing. Publish it as Not Public, so that it will be a non-certified channel you can have pushed back to your Roku device as an installed channel from Roku. Once you publish a non-certified channel make sure you add it using the vanity link, and it should be pushed to your Roku device within minutes or seconds.
On the site, under in-channel products, click on the product name in the list and it will bring up all the channels that can use the product. Click on the channel selector and add your new "My Channel TEST" channel. Do this for all products that this channel can use.
What I haven't seen published anywhere can drive you crazy if you're not aware.... when you add a new product, or assign a new channel to an existing product, it can take up to one hour for Roku to actually allow the product to be purchased. That is, your channel will most likely crash when you call the purchase method, and your Roku will reboot. If your Roku crashes when trying to purchase a product for real or for testing, give Roku more time.
Under test users you always want to add your Roku e-mail address so that you won't accidentally get billed when you're designing a channel with products. The purchase of course will go through but no charge will be made to you.
Once your TEST channel is working as you want it, upload the same package to your original channel and republish it.
So, to recap. Forget trying to test billing using the fake store/products from a side-loaded channel. It's much quicker, but you'll just have to remove that code in the final channel, no?
Great advice. What got from Roku was that my channel does not have a trial period option in billing, which causes some of the code to not execute. Not sure why Roku would not have it built into the template a way for developers who don't want the trial option available to still offer subscriptions. Looking to modify the template code to reflect this. Any ideas?
If you are running the sample without any modifications, then yes, you do need to have at least one in-channel product with a free trial per the doc: https://developer.roku.com/videos/courses/rsg/subscriptions.md#sample-channel-notes.
But feel free to modify the code to fit your product catalog. For example, maybe you can try removing lines 104-105 from the subscription logic file (https://github.com/rokudev/scenegraph-master-sample/blob/master/DeepLinking/components/UILogic/Subsc...). That way the code is not looking for products with a free trial.
Appreciate the response! Still working through my understanding of how it works. Looks like lines 104-105 are part of a code block and would break code flow if they were deleted. Is there a suggestion for what I should replace line 104-124 with since that looks to be the entire block related to my problem? Or am I missing something? I appreciate your help! You have no idea!
As far as I know you can choose to offer a trial period for a product from the Developer's portal, and Roku will handle the rest. I don't think your channel has to have special code for it. In fact, you can set a discounted rate for X number of months as well. I've tested this feature, and Roku will mention the deal when the subscription dialog with PIN pad pops up on the screen.
My advice on the free trial feature is that you better have some cash on hand to throw at AWS in case your channel becomes popular in a short time and viewers start eating your lunch. Once the trial is over, many viewers will flee.
This is exactly the reason I DON'T want to start out with a free trial! This is what I got in an email from Roku:
It looks to me that the logic in your channel (SubscriptionLogic.brs) essentially will only display products that either have a free trial that has not expired or have a free trial that has expired.
None of your products (I looked at them) have a free trial at all.
Because of that, the condition to display a product will never be met because the logic for displaying products will only be followed if m.isProductWithExpiredTrial is true, or false and a non-zero free trial quantity.
Since in sub OnGetPurchases when it sees a product with no trial then purchase.expirationDate="" the value of the date is 0 and that results in utimeExpire being zero and utimeNow = the current time - so the expiration date is never in the past, meaning m.isProductWithExpiredTrial is never false, and product.freeTrialQuantity is always 0 when the if product.freeTrialQuantity >0 is encountered in the else part of your statement
if m.isProductWithExpiredTrial
' if trial has been already used
' then show only products without trial
if product.freeTrialQuantity = 0
subscriptions.Push(product.name + " " + product.cost)
m.activeCatalogItems.Push({
code: product.code,
name: product.name
})
end if
else
'if trial hasn't been already used
' then show only products with trial
if product.freeTrialQuantity > 0
subscriptions.Push(product.name + " " + product.cost)
m.activeCatalogItems.Push({
code: product.code,
name: product.name
})
end if
end if
Not sure how to modify this code to have it not look for a trial product. I was told to look at lines 104-105.
Actually it should have been just line 105 that gets removed...and the code block would be as follows:
for each product in catalog.GetChildren(-1, 0) ' if trial has been already used, then show only products without trial if product.freeTrialQuantity = 0 subscriptions.Push(product.name + " " + product.cost) m.activeCatalogItems.Push({ code: product.code, name: product.name }) end if else ' if trial hasn't been already used then show only products with trial if product.freeTrialQuantity > 0 subscriptions.Push(product.name + " " + product.cost) m.activeCatalogItems.Push({ code: product.code, name: product.name })
end if
end if
end for