Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 3    Views: 60

amysus
Lost but trying
Profile
Posts: 90
Reg: Oct 28, 2011
traveling the w...
3,650
06/08/16 03:57 PM (8 years ago)

In App Purchases and Audio File Downloads

Hi again ... yet another question from this newbie. I am designing an app that will have in app purchases, but I am unsure of how this will behave in the app. This is an iOS audio app. If I include a short audio sample (e.g., 20 seconds), when the user purchases the full audio file via the In App Purchase plugin, will the file download (so that it is stored locally) and replace the sample (assuming the sample file and full version file are named identically)? Or perhaps I need to have a different section in my app, a Store section, that will have the link to the sample online and a link to purchase the file, then once purchased, the hidden page (with access to the full version) will "unlock." The user will still need a way to download the file though. (I don't want to include the full file, hidden, as the app is going to be very large and no use making people download and store all those files if they don't have access to them.) Anyway , insights into how this thing works from the end user and interface design point of view (I've not even gotten to implementing it in BT and xCode, that will come later, along with more questions, no doubt). Much thanks, Amy
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/09/16 02:48 AM (8 years ago)
There are a couple of different ways to address this. But know this: when your app is reading the audio file, it is reading it from cache. If the audio is contained within the bundle, it is copied to cache and played. If the audio is available on the internet, it is downloaded into cache, and played from cache. And the user may one day clear their cache. If so, and they paid, keep your eye on a record of purchases. You can always download a file that is 'hidden' on your website from within an app. Ensure you have directory security, and not just 'website' security; there are ways around that if not attended to. this is to keep web spiders from finding your loot. You can then use the appropriate credentials hard (or config) coded within your app. I think besides the custom code, a nice way to do it would be to add custom json values to your app so that you could reuse the code for different clients later. Just parse for the custom values from your method, and use them in conjunction with the string sent to the backend to authenticate and retrieve the data (music). That's all in theory, and in reality it might use a bit of massage, but it's one way to consider... Cheers! -- Smug
 
amysus
Lost but trying
Profile
Posts: 90
Reg: Oct 28, 2011
traveling the w...
3,650
like
06/09/16 01:34 PM (8 years ago)
Thank you. On this day, at this hour ... (and probably tomorrow and next week ...) over my head. But, curious about the first thing you wrote, "when your app is reading the audio file, it is reading it from cache. If the audio is contained within the bundle, it is copied to cache and played. If the audio is available on the internet, it is downloaded into cache, and played from cache." Are you saying that either way, packaged into the app or streamed, the file is put into cache?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/09/16 03:17 PM (8 years ago)
That is correct. typically a file is copied to cache, and then 'dealt with' depending on the type of file. Cheers! -- Smug
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.