Enabling In-App Purchase for iOS8 Custom Keyboard

I am creating a custom keyboard for iOS and I want to know how can I enable in-app purchases for this? The documentation states that I can enable in-app purchases through the containing app, but I'm not sure what that means (technically)?

Has anyone created an in-app purchase iPhone extensions that could give me some guidance?

+3


source to share


3 answers


The extension comes with the application. When the user loads the containing app, the extensions are available for the user to add to their list of keyboards, today's view, etc. If you want to charge a fee for the keyboard, currently the only way to do this is to charge for an app that contains a keyboard extension.



+1


source


Just to be clear, Inapp purchases from any app extension, including the keyboard, are not allowed and this will cause your app to crash. Inapp purchases must be done in a container app. Below are the current recommendations for revising the annexes.

https://developer.apple.com/app-store/review/guidelines/

  1. Extensions

25.1 Application hosting extensions must comply with the Application Extensions Programming Guide

25.2 Application hosting extensions must provide some functionality (help screens, advanced settings) or they will be rejected

25.3 Apps that extend hosting that include marketing, advertising, or in-app purchases in their extended view will be rejected



25.4 Keyboard expansions should provide a way to navigate to the next keyboard

25.5 Keyboard expansions must remain functional without network access or be rejected

25.6 Keyboard expansions must provide numeric and decimal keyboard types as described in the Application Extensions Programming Guide or they will be rejected

25.7 Apps offering keyboard extensions must have a Utilities main category and a privacy policy or they will be rejected.

25.8 Apps offering keyboard extensions may only collect user activity to improve the functionality of the keyboard extension on an iOS device, or they may be rejected.

0


source


I am trying to do this too. I want to enable in-app purchase so people can buy additional keyboard items. I am trying several ways not to make it work. I think it would be impossible to directly do this from the keyboard.

I first tried to directly make an in-app purchase from the keyboard:

- (IBAction) buySomething:(id)sender {
    SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers: [NSSet setWithObject:@"productid"]];
    request.delegate = self;
    [request start];
}

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
    // It never gets here.
}

      

Then I tried to see if I could launch the container app from the keyboard, but nothing happens. In info.plist I have URL types> Item 0> URL Schemes> Item 0> myurlscheme.

[self.extensionContext openURL:[NSURL URLWithString:@"myurlscheme://#"] completionHandler:nil];

      

All I can think of is just showing instructions for launching a container app, but I'd rather do this paid app than this.

-1


source







All Articles