Using the Mobile API iOS Library
Mobile API: iOS
Creating a Project
The fastest way to get started is to check out the PaymentGatewayEncryptionExample and PaymentGatewaySwipeExample projects that can be downloaded from the Payment Gateway's Integration section. If you prefer to create your own project instead, use these steps (current as of Xcode 5.0):
- Download the Mobile API .zip file from the Integration Portal by using the "Downloads" link under the Mobile API section. This file contains both the iOS and Android libraries.
- Create a new Xcode Project.
- Copy the files in the .zip file into your project folder, and add them to your Xcode project. The files you will need are PGMobileSDK.a and the entire folder PGMobileSDK containing the headers. These are found in the .zip file under Apple iOS -> Payment Gateway SDK.
- Under the project's Build Phases settings, add these libraries to the Link Binary With Libraries section:
- (Optional - see note below) - In your Info.plist, add a row for "Supported external accessory protocols", and add "com.gatewayprocessingservices.iprocess" as Item 0. This enables connection to the iDynamo swipe reader.
Note: You may wish to skip step 5 if you do not need to support the iDynamo. Apple requires manufacturers of accessories that use the dock connector to add your app to their product plan before approving your app for the app store. You will need to contact MagTek in order to have your app added to their product plan. Contact MagTek for more details.
Viewing documentation in Xcode
Adding the doc set to Xcode allows the most up-to-date, relevant documentation to appear in the IDE as you type. To enable access to the SDK documentation from inside Xcode:
- Under the Xcode menu, click Preferences
- Navigate to the Downloads page
- On the Documentation tab, click Add.
- On the "Enter a doc set feed URL" window that pops up, enter: https://secure.safewebservices.com/merchants/resources/integration/docset/iOSSDK.atom
- Click Add
- Click the newly-added install button
Important Info About the App Store
The Apple App Store's current policy is to require mobile apps to purchase digital goods (e.g. downloadable content, etc.) through the App Store. For that reason, this SDK is intended only for use in apps selling real-world goods and services. Please direct questions about Apple's App Store policies to Apple. Their policies are subject to change at their discretion.