Billing usage was specified during channel publishing but was not found in BrightScript code

I am getting this error in static analysis while publishing app.
“Billing usage was specified during channel publishing but was not found in BrightScript code.”
I have added billing code in my Home Scene.
Please help.

I, too, am having the same issue. Can anyone recommend a solution?

Thanks.

Submit your app with this error and Roku store will accept it. You don’t need to do anything.
Sometimes Roku AI does not work to verify Brighscript.

This does not seam to work anymore. Schedule publishing is greyed out.

I am using ChannelStore to query subscription status and submit an order but the static analysis tool is not picking it up.

When you query roChannelStore and wait for the response, check the type of the returned message. I have this in my code, so I must have dealt with this before.

 while true
     msg = wait(0,port)
     print type(msg)
     if msg <> invalid and type(msg) = "roChannelStoreEvent" then  ' check for type is just to pass Static Analysis
      ...
end while

Simply adding that check did not pass static analysis.

I am not using the roChannelStore object, I am only using the component.

Does static analysis only support roChannelStore?

RESOLVED!
I found the solution in the scenegraph-master-sample repo/Subscriptions repo.

' to handle Roku Pay we need to create channelStore object in the global node
m.global.AddField("channelStore", "node", false)
m.global.channelStore = CreateObject("roSGNode", "ChannelStore")

I was using a element in the XML.

Thanks for letting us know! I was going to suggest just creating a dummy roChannelStore element to get past the analysis. May have been a hack, but probably would have worked.

I am also getting same error. Can someone tell me how can I resolve this error,

How did you resolve this?

Did you read the thread?! The solution has already been posted.

Yes I read. Please, can you simply suggest what code changes, I have to do and where to fix this error.

You must be new to development. One cant simply suggest what code change must be made without seeing your code. :slightly_smiling_face:

Please study this sample. This implementation passes the static analysis tool and you can model your solution based on that.

https://github.com/rokudev/scenegraph-master-sample/tree/master/Subscriptions

Weird I’m using this exact way to create and handle channelstore but I’m still getting this error. I’m implementing a TVOD channel so my logic is from tvod-sample-master from here
https://github.com/rokudev/samples/tree/master/roku%20pay

I also have authentication built into the channel when user tries to play a paid content. I don’t understand what could cause this issue

Its been a couple of months, so the exact details are sketchy.

I was following this sample to create the in app purchase (without login):
https://github.com/rokudev/samples/blob/master/roku%20pay/SimpleChannelStore.zip

After completing the app, I could not pass static analysis until I made the channel store node a global rather than a member variable.

m.global.AddField("channelStore", "node", false)
m.global.channelStore = CreateObject("roSGNode", "ChannelStore")

Does anyone have example for Screensaver (RunScreenSaver())? I have tried to create and handle channelstore as suggested here but it’s not working for screensaver case. Any ideas?

If you intend to handle in channel billing for a screensaver you will need to add a “RunScreenSaverSettings” entry point. This will available on the system screensaver chooser. Otherwise if you want the channel to be a one time purchase, just set it in the dev portal monitization option.

https://developer.roku.com/en-us/docs/developer-program/media-playback/screensavers.md