iOS Integration
What is the PRYYNT iOS SDK?
Our iOS SDK allows you to add the PRYYNT button into your app in a few minutes! Your users will then be able to order prints using any of the images in your app or on their device. After clicking the PRYYNT button the PRYYNT UI will open up as an in-app browser. To integrate our SDK please follow the simple steps below.
You can download our SDK, including the full source code, an example app and tests here (917KB). Our latest SDK is compatible with iOS 9!
Step 1
- Drag and drop PryntPlugin.xcodeproj into your project.
- Add PryyntPluginResources under Target Dependencies.
- Add PryntPlugin under Target Dependencies.
- Add libPryyntPlugin.a under Link Binary With Libraries.
- Drag and drop PryyntPlugin.bundle to the Copy Bundle Resources of your Project Target.
Please note that PryyntPlugin is dependent on the following iOS libraries which must be linked by your app:
- CoreGraphics.framework
- ImageIO.framework
- MobileCoreServices.framework
- SystemConfiguration.framework
Step 2
Set the following parameters into your app using the Pryynt static class. Make sure that you replace YOUR_APP_KEY with your application API key. To get your API key, please register your app here or if you are already registered, log in here.
Remember to enclose the API key in quotes, as shown below. Please note that each app or website has its own unique API key, so if you have registered several apps and websites with PRYYNT make sure you use the correct API key for each app or website.
[Pryynt setPryyntBaseUrl:@"https://pryynt.me/"]; [Pryynt setApplicationKey:@"YOUR_APP_KEY"]; [Pryynt setPreferredLanguage:@"en-gb"]; [Pryynt setPreferredCurrency:@"USD"];
Step 3
Select the products you want to make available to your users here. If you are not already registered please register here. That's it! The PRYYNT button will now be available in your app and you can start monetizing your images.
Configuration Parameters
Below is a list of the PRYYNT SDK configuration parameters that you must use in your apps.
Parameter Name | Required | Default Value | Comments |
---|---|---|---|
setPryyntBaseUrl | Yes | None |
URL to the environment you want to use.
|
setApplicationKey | Yes | None |
The application API key, which you can obtain here. |
setPreferredLanguage | Yes | None |
The ISO-639-1 language code, followed by the ISO 3166-1 alpha-2 country code, to be used in the PRYYNT UI. The following languages are currently available:
|
setPreferredCurrency | Yes | None |
The ISO-4217 currency code that will be used in the PRYYNT UI. All prices will be shown in this currency. The following currencies are currently available:
|
Methods
The 4 methods below are available through the PRYYNT iOS SDK.
Upload an image by specifying a public URL. In this case only a URL will be sent to the PRYYNT API. Our servers will request that URL and get the image. This is the ideal method of sending an image to PRYYNT since no image binary data has to be transmitted from the user's device to PRYYNT's servers.
[Pryynt uploadImageURL:imageUrl successBlock:^(PryyntResult *pryyntResult) { } failBlock:^(PryyntResult *pryyntResult) { } errorBlock:^(NSError *error) { } ];
Upload an image from the device's memory (UIImage).
[Pryynt uploadImage:image successBlock:^(PryyntResult *pryyntResult) { } failBlock:^(PryyntResult *pryyntResult) { } errorBlock:^(NSError *error) { } ];
Upload an image from the device's filesystem.
[Pryynt uploadImageFile:fileUrl successBlock:^(PryyntResult *pryyntResult) { } failBlock:^(PryyntResult *pryyntResult) { } errorBlock:^(NSError *error) { } ];
Open the PRYYNT UI.
[Pryynt openPryyntPopupOnViewController:self];