Please follow these instructions to integrate Braintree iOS into your app using the provided static library.
Note: We assume that you are using Xcode 8+ and iOS 9.0+ as your Base SDK.
- Add the Braintree iOS SDK code to your repository
- Download the SDK as a ZIP file from GitHub and unzip it into your app's root directory in Finder
-
Open up your app in Xcode
-
Add Braintree as a subproject
- Open your project and drag the Braintree.xcodeproj file to your Project Navigator under your project. Be sure NOT to have the Braintree.xcodeproj open while doing this step.
- Add
Braintree
to your build phases ([Your App Target]
>Build Phases
)
-
Target Dependencies
- Click the
+
and addBraintree
- Click the
-
Link Binary With Libraries
- Click the
+
and addlibBraintree.a
- Click the
- Add
localized strings
toCopy Bundle Resources
([Your App Target]
>Build Phases
)
- In the Project Navigator, locate the
UI.strings
(Braintree.xcodeproj
>BraintreeUI
>Localization
>UI.strings
) - Drag the
UI.strings
file from the Navigator to theCopy Bundle Resources
panel and drop it - Repeat for remaining localized strings
Drop-In.strings
(Braintree.xcodeproj
>BraintreeUI
>Drop-In
>Localization
>Drop-In.strings
)Three-D-Secure.strings
(Braintree.xcodeproj
>Braintree3DSecure
>Localization
>Three-D-Secure.strings
)
- Modify your build settings (
[Your App Target]
>Build Settings
)
-
Update
Header Search Paths
- Add
$(PROJECT_DIR)/braintree_ios
(or whatever the name of the braintree folder at the top level of your project is) - Be sure to select recursive from the drop down at the right
- Add
-
Update
Other Linker Flags
- Add
-ObjC
- Add
-
Build and Run
your app to test out the integration