Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry® World™ Development

Reply
Developer
thubalek
Posts: 323
Registered: ‎10-01-2012
My Device: Dev Alpha C, Playbook 32 GB
Accepted Solution

How often to call PaymentManager to detect purchased digital goods

Hello,

 

I didn't found in documentation how often I can call Payment Manager (Cascades, BB10) for detection of purchased digital goods.

 

I'm doing it everytime app starts hoping that it is somewhere cached but not sure whether it is good idea. 

 

Can anybody from BB suggest what is best practice?

 

Tom

--------------------------------------------------------------------------------------------
-- My Blackberry 10 app at http://blackberry.hubalek.net
-- My Android apps at http://android.hubalek.net
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: How often to call PaymentManager to detect purchased digital goods

I'm fairly sure best practice would be for you to cache the information locally yourself, to avoid any unnecessary network activity. I've seen nothing in the docs to suggest it would be caching anything like that in a central location. I don't know for sure that it doesn't, but that's the sort of thing I'd expect to see documented clearly if they were doing it.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
thubalek
Posts: 323
Registered: ‎10-01-2012
My Device: Dev Alpha C, Playbook 32 GB

Re: How often to call PaymentManager to detect purchased digital goods

There are signs of caching in the documentation.

 

See parameter  forceServerRefresh at https://developer.blackberry.com/cascades/reference/bb__platform__paymentmanager.html#requestexistin...

 

I want to avoid caching on my side if Blackberry Platform already does it. 

 

This is the reason why I'm asking here and hoping to get ultimate response from Blackberry.

--------------------------------------------------------------------------------------------
-- My Blackberry 10 app at http://blackberry.hubalek.net
-- My Android apps at http://android.hubalek.net
Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: How often to call PaymentManager to detect purchased digital goods

Hi there,

 

The App World cache should be thought of in the same way as a browser's cache, data will get cached but could be cleared out at any time if desired by the app (in this case App World).

 

The recommended approach would be to first try to retrieve purchases from the cache, if these do not exist then you could refresh from the App World Server.

 

Another good idea would be to store these purchases yourself rather than relying on App World at all. This will save you from having to check for existing purchases over the network every time the app is launched.

Garett
@garettBeuk
--
Goodbye everybody!
Developer
thubalek
Posts: 323
Registered: ‎10-01-2012
My Device: Dev Alpha C, Playbook 32 GB

Re: How often to call PaymentManager to detect purchased digital goods

Thanks for reply gbeukeboom

So there will be exactly the same issues with license verification as on Android are. 

--------------------------------------------------------------------------------------------
-- My Blackberry 10 app at http://blackberry.hubalek.net
-- My Android apps at http://android.hubalek.net
Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: How often to call PaymentManager to detect purchased digital goods

Hi Tom,

 

Developers don't "need" to implement storing the digital goods themselves, all data can be retrieved from App World either using the cache or network and actually a network refresh of App World should always be done at least once in the application lifecycle to account for a few scenarios.

 

The App World cache should be a good place to check for this data, but it cannot be guaranteed to be there all of the time.

Garett
@garettBeuk
--
Goodbye everybody!