Discussion Forums  >  Uncategorized

Replies: 16    Views: 684

MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
09/03/11 04:39 PM (14 years ago)

In App Purchasing Working. Now complex question.

Complicated question here. I've successfully built an app utilizing BT and the UrbanAirship in app purchase module. I can make purchases and download the purchased content. This is really great for things like songs or pdf files. As a test, I created a pdf file as my content to purchase. Test purchase worked fine. It downloaded, and I was able to use the BT pdf option to access the file. Really cool. The content downloads to the directory 'Library/ua/downloads/<product_id>/<contents of zip file>' Now, here the question for the BuzzTouch and iOS gurus. What I'd like to do is create a BT_Plugin that is accessed from the main menu. It would check to see if the downloaded content exists. If it does, it would populate a submenu. If the content does not exist, it would open the store front viewer. I've set up 'myplugin.h' and 'myplugin.m' files in the BT_Plugins directory. I can access that file from the menu, but I'm not getting any success having it check if the downloaded file exists. Here's the .m code section: //does file exist + (void)initialize { NSString *productId = @jce.msu.buz; NSString *productDirectory = [kUADownloadDirectory stringByAppendingPathComponent:productId]; } +(BOOL)doesLocalFileExist:(NSString *)productDirectory{ BOOL success = FALSE; if(productDirectory != nil && [productDirectory length] > 1){ NSFileManager *fileManager = [NSFileManager defaultManager]; success = [fileManager fileExistsAtPath:[self getFilePath:productDirectory]]; if(success){ [BT_debugger showIt:self:[NSString stringWithFormat:@File does exist in directory: %@, fileName]]; success = TRUE; }else{ UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@loginRequired,@~ Login Required ~) message:NSLocalizedString(@NotPurchasedMessage, @You have not purchased this team. Please click the store button to purchase.) delegate:self cancelButtonTitle:NSLocalizedString(@ok, OK) otherButtonTitles:nil]; [alertView setTag:101]; [alertView show]; [alertView release]; //bail return; } } return success; } Anyone able to give me some help with this? Thanks.
 
Stefan
buzztouch Evangelist
Profile
Posts: 558
Reg: Dec 21, 2010
Sweden
14,780
like
09/04/11 10:18 AM (14 years ago)
So this is hard to fix? Bummer. I really want to create a app that will offer in app purchase. I´m gonna stick to this thread and hopefully I learn something.
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
09/04/11 11:00 AM (14 years ago)
If your in app purchase is something like a pdf book, mp3 file or image, it will work fine. Also, if you built out an html series of screens, that would probably work well too. I'm just trying to do something much more complicated. Hopefully someone has an answer or can point me in the right direction. It can't be that hard. I'm just not quite getting it.
 
Stefan
buzztouch Evangelist
Profile
Posts: 558
Reg: Dec 21, 2010
Sweden
14,780
like
09/04/11 01:02 PM (14 years ago)
I´m about to create a app with songs in it. But before I even start there I got like 8 new apps lined up calling for my attention :)
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
09/05/11 09:58 PM (14 years ago)
Hi Guys. MGoBlue's the guru! I'm a bit confused. In blue's setup, the document downloads to here: Library/ua/downloads/<product_id>/<contents of zip file> Is this intentional? Normally, downloads in a BT app go to the Documents directory (not the Library). If you download to the document directory you can use the built in BT method: +(BOOL)doesLocalFileExist:(NSString *)fileName in the BT_fileManager.m class. Like... if([BT_fileManager doesLocalFileExist:@mypdf.doc]){ ....show the menu of documents... }else{ ...show the store view cotnroller... } If building the menu of previously downloaded items, I can imagine doing a loop in the Documents directory and looking at each downloaded file. If all the downloaded purchases used a naming convention, like purchase_mydocument.pdf OR purchase_mysong.mp3 or whatever...you could search the file names in the Document's directory while you looped through the files and add only those that contained 'purchase_' to the menu. Lots of ways to do this I guess. Just trying to get my head around how it's working now.
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
09/06/11 04:45 PM (14 years ago)
Urban Airship's method downloads to the Library. I'll check out their docs and see how I can change the download destination. That may help. Thanks for the code suggestions. I'll check things out and get back to you.
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
09/13/11 10:36 AM (14 years ago)
Hi MGoBlue, wondering how your in app purchases are coming along....are you working out a container app for all your other apps? have something i am working on that i think is gonna need to do the same...what i would like to do is have one price for the container app and the apps inside the container app are free to download...any ideas and help are greatly appreciated :)
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
10/03/11 10:16 PM (14 years ago)
@Ian - I got busy on some other projects and haven't gotten back to this one yet. One of these days... It will probably help you with the app you emailed about.
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
10/03/11 10:20 PM (14 years ago)
Hi MGoBlue, got ur email...hope we can make this work...thanks!!! :)
 
Stefan
buzztouch Evangelist
Profile
Posts: 558
Reg: Dec 21, 2010
Sweden
14,780
like
10/04/11 12:09 AM (14 years ago)
I´m about to implement in app purchase now on one of my running apps. I'm gonna sell songs in the app. I'll let you know how it progresses and also I will try to make a manual for those interested. BR/Stefan
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
10/04/11 12:10 AM (14 years ago)
Awesome!!
 
fplamorim
Apple Fan
Profile
Posts: 11
Reg: Sep 05, 2011
Boca Raton
110
like
11/03/11 08:36 PM (14 years ago)
Hi Stefan, any news? did work? I am very interested on your manual! :-)
 
Mag37
Apple Fan
Profile
Posts: 71
Reg: Mar 31, 2011
USA
6,610
like
12/02/11 10:45 AM (14 years ago)
Hi Stefan did you ever get around to the manual? Really interested how you made out....
 
Stefan
buzztouch Evangelist
Profile
Posts: 558
Reg: Dec 21, 2010
Sweden
14,780
like
12/02/11 11:23 AM (14 years ago)
Sorry guys! I've been occupied with other tasks so I haven't been looking into this at all. When I tried though I got stuck and I haven't been able to find a solution for it. BR/Stefan
 
mitchellapps
Aspiring developer
Profile
Posts: 170
Reg: Aug 15, 2011
St. Louis
4,300
like
12/09/11 09:11 PM (14 years ago)
Hey @MGoBlue, did you ever release an app with in-app purchasing? I wanted to see an example of someone getting that done with Buzztouch. Loved your push notifications tutorial. Would love to see an in app purchasing tutorial!
 
tb
buzztouch Evangelist
Profile
Posts: 2050
Reg: Nov 03, 2011
Oxford
32,300
like
01/19/12 04:41 PM (14 years ago)
As you guys know quite a lot about how to implant an In-App Purchase I to an app, would any of you like to create a very quick and basic tutorial on how to do this. If you wouldn't mind, could you do it on my thread. There is a lot of heat on that thread already from people saying that they are subscribing and so on. It would be really beneficial to many members of Buzztouch. My thread is: http://www.buzztouch.com/forum/thread.php?tid=4ADE993C33279F5D30E4124&status=&searchInput=In-App%20Purchase&sortColumn=FT.dateStampUTC&sortUpDown=DESC¤tPage=1&doViews=1 Thanks, Annandale Apps
 
Tony @ Buzztouch
buzztouch Evangelist
Profile
Posts: 528
Reg: Mar 05, 2011
Saint Louis, Mi...
24,620
like
05/22/12 06:33 PM (13 years ago)
I would like to build in app purchases in my app. Basically I want to sell a webpage to my users which I am calling a premium feature. Does anyone have a step by step on this? Been reading everything on in-app but i just dont know where to start. Thanks Tony
 

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.