Demo app to take you to full version on iOS App Store

  1. 3 months ago

    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

  2. Would this function work? Taken from the Xojo docs:

    Function ShowURL(url As Text) As Boolean
      ' NSString* launchUrl = @"http://www.xojo.com/%22;
      ' [[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"))
      
      ' https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/#//apple_ref/occ/clm/NSURL/URLWithString:
      Declare Function URLWithString Lib "Foundation" Selector "URLWithString:" (id As Ptr, URLString As CFStringRef) As Ptr
      Dim nsURL As Ptr = URLWithString(NSClassFromString("NSURL"), url)
      
      ' https://developer.apple.com/Library/ios/documentation/UIKit/Reference/UIApplication_Class/index.html#//apple_ref/occ/instm/UIApplication/openURL:
      Declare Function openURL Lib "UIKit" Selector "openURL:" (id As Ptr, nsurl As Ptr) As Boolean
      Return openURL(sharedApp, nsURL)
    End Function
  3. Tim P

    Jun 6 Pre-Release Testers Rochester, NY

    App Store Review Guidelines - Apple Developer

    2.2 Beta Testing
    Demos, betas, and trial versions of your app don’t belong on the App Store [...]

  4. 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?

  5. Jason K

    Jun 8 Pre-Release Testers
    Edited 3 months ago

    @Ryan H 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.

    https://github.com/kingj5/iOSKit

    Edit: Example isn’t actually in iOSKit but separately on Dropbox. Look at this conversation for details:
    https://forum.xojo.com/37483-how-integrate-in-app-payment-in-ios-app

  6. Gavin S

    Jun 8 Pre-Release Testers UK

    Just to give you some motivation, In-App Purchase in iOS definitely works and a number of Xojo developers use it successfully, particularly @Jeremie L

    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.

  7. 2 months ago

    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

or Sign Up to reply!