Hi. Probably a silly (and easy) question, but what is the process for opening the App Store from a demo app? I was thinking ShowURL as in desktop, but this doesn’t seem to be available in iOS. I am making a demo app of my iOS apps and wanted to include a Purchase screen that takes the user right to the product page on the App Store. Would you use an HTMLViewer?
I know, I know, I should be doing in-app purchases, but I don’t really know how that process works
Would this function work? Taken from the Xojo docs:
[code]Function ShowURL(url As Text) As Boolean
’ NSString* launchUrl = @"http://www.xojo.com/";
’ [[UIApplication sharedApplication] openURL:[NSURL URLWithString: launchUrl]];
Declare Function NSClassFromString Lib “Foundation” (name As CFStringRef) As Ptr
Declare Function sharedApplication Lib “UIKit” Selector “sharedApplication” (obj As Ptr) As Ptr
Dim sharedApp As Ptr = sharedApplication(NSClassFromString(“UIApplication”))
Declare Function URLWithString Lib “Foundation” Selector “URLWithString:” (id As Ptr, URLString As CFStringRef) As Ptr
Dim nsURL As Ptr = URLWithString(NSClassFromString(“NSURL”), url)
Declare Function openURL Lib “UIKit” Selector “openURL:” (id As Ptr, nsurl As Ptr) As Boolean
Return openURL(sharedApp, nsURL)
App Store Review Guidelines - Apple Developer
[quote]2.2 Beta Testing
Demos, betas, and trial versions of your app dont belong on the App Store […][/quote]
Yikes and crud. Thanks Tim. Guess I have to determine how to work with in-app purchases then. There’s no tutorial using Xojo you’re aware of, is there?
Take a look at my iOSKit. There is a small example of how to use in app purchases and the classes are fully working for several people here on the forum. My classes and examples are based on tutorials from Ray Wenderlich which you can find online with google. You can also search the forum where there is some discussion on them as well.
Edit: Example isnt actually in iOSKit but separately on Dropbox. Look at this conversation for details:
Just to give you some motivation, In-App Purchase in iOS definitely works and a number of Xojo developers use it successfully, particularly @Jeremie Leroy
I got it working by reading through the related threads on the forum and using Jason’s example.
Here a few things from my notes:
Create Apple IDs to test your purchases but don’t sign in with them. Only login when prompted to via the app and there should be a message that says Sandbox Environment in the dialog. i.e. run the app on a device that isn’t signed in with any Apple ID, and attempt to purchase an IAP, then login when you see that message.
You can’t test IAP in the Simulator so don’t even try
You must sign in to icloud.com in a browser with your test Apple IDs, to accept the terms and conditions
There are lots more bits and pieces along the way to be aware of but give it a go and tell us how far you get, I’m sure we can help.
Thank you Jason and Gavin. I know it is possible and I am looking forward to getting IAPs integrated in some of my future apps. I appreciate the motivation and will be sure to post back when I have questions. Thanks again all