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

Adobe AIR Development

Reply
Regular Contributor
JimmyO
Posts: 93
Registered: ‎02-03-2011
My Device: Not Specified

in-app asset additions with in-app purchases

Hi folks -

 

I am building a game/puzzle app that will have different games/puzzles for the user to solve.  I plan to include several of the puzzles wtih the first purchase of the app and then eventually offer in-app purchases so that the user can purchase more puzzles when these APIs are fully available.   Some questions:

1. how does one include a file within the .bar that is uploaded (ie the file that includes my first list of puzzles) and how does one access that file from within the app?  Specifically what directory/path does it get stored in as I can't seem to find it using the different paths that are in the documentation using the loader.load command.

2. When an in-app purchase is made a new file provided, where does that get stored and what path would one use to access it?

Thanks to anyone who can point me in the right direction.

 

...Jim

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: in-app asset additions with in-app purchases

Files under /src can be added to the installation but the folder has to be defined in the BB package command to be included. Once the BAR file has been created, you can open it to verify.

Those files will be accessible from File.applicationDirectory. This is a read-only directory structure and you cannot store information here. You can store data in File.applicationStorageDirectory. If you want to manage both set of files in the same app-storage directory, then upon the first run of the application, you will need to *copy* files from app/myfolder to app-storage/myfolder.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: in-app asset additions with in-app purchases

 

@JimmyO, it's not clear whether you know this, so I'll point it out just in case.  The digital goods do not themselves include the file(s) that you want to install.  See Distributing digital goods in the Payment SDK docs.  That means you actually need either to include the data in your app to begin with, and purchasing the digital good merely "unlocks" it (up to you how that's implemented), or you need to distribute the data from your own server (again, your choice of implementation).

 

This means that it's up to you to decide where you want to store the files, assuming you'll download them after the purchase.  That ties back to John's answer... the data will be either in the shared/ folder tree (inadvisable in many cases, but technically fine) or in the app's so-called appstorage area, which is under File.applicationStorageDirectory.


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!
Regular Contributor
JimmyO
Posts: 93
Registered: ‎02-03-2011
My Device: Not Specified

Re: in-app asset additions with in-app purchases

Thank you Peter and John for the information and link. I previously DID believe that the actual goods came in a download but now understand that they do NOT.

 

...Jim