-
Notifications
You must be signed in to change notification settings - Fork 2
Publishing to Paddle & MAS
Many developers choose to publish their apps using Paddle as well as distributing via the Mac App Store. Apple have a number of guidelines/rules for apps that wish to be available on the MAS. Below is a guide on setting up your Xcode project to only include the Paddle framework in a Paddle build while leaving the MAS build of your app intact.
This guide assumes that you already have an app published in the MAS and want to create a Paddle version. You should also be able to use information in this guide for other cases.
To start with you should duplicate your existing target.
Once you have created a second target for your Paddle version you can follow the normal documentation for adding the Paddle framework. Keeping in mind that when you add the framework you should ONLY add it to the Paddle target version of your app and not the MAS version.
##Preprocessor Macros
From your Paddle target, you can add a Preprocessor Macro, which can be used in code to determine which version of the app is being built and add any Paddle framework specific code when needed.
Start by going to 'Build Settings' and looking for 'Preprocessor Macros'. As you can see from the screenshot we have added a macro called PADDLE_VERSION
. Be careful to only add this to the Paddle target.
You could also add a macro to the other target, such as MAS_VERSION
, use whichever suits your particular case.
##Determine target in code To determine which version is being built and only include Paddle functionality when appropriate, simply wrap any Paddle framework code within
#if defined(PADDLE_VERSION)
...
#endif
Below is an example of how you might achieve this:
#if defined(PADDLE_VERSION)
#import <Paddle/Paddle.h>
#endif
#if defined(PADDLE_VERSION)
Paddle *paddle = [Paddle sharedInstance];
[paddle setProductId:@"491452"];
[paddle setVendorId:@"389"];
[paddle setApiKey:@"e804e5ba7480af14e596d0272031bc01"];
NSDictionary *productInfo = [NSDictionary dictionaryWithObjectsAndKeys:
@"10.00", kPADCurrentPrice,
@"Test Developer", kPADDevName,
@"USD", kPADCurrency,
@"http://www.macupdate.com/util/iconlg/17227.png", kPADImage,
@"Test Product 2", kPADProductName,
@"7", kPADTrialDuration,
@"Thanks for downloading a trial of our product", kPADTrialText,
@"paddleicon.png", kPADProductImage, //Image file in your project
nil];
[paddle startLicensing:productInfo timeTrial:YES withWindow:self.window];
#endif