Setup and Integration
Starting October 1, 2026, the Drop-in SDK will be deprecated. No new features, improvements, or bug fixes will be released after this date. Payment processing will continue to be supported until October 1, 2027, but we strongly recommend migrating to the Braintree SDK as soon as possible to avoid future disruption.
Starting October 1, 2027, the Drop-in SDK will become unsupported. Braintree support team will no longer provide assistance for this SDK, and payment processing may be suspended at any time.
Action required: Migrate to the Braintree iOS SDK to continue processing payments and receive ongoing updates, security fixes, and support.
Configuration
To use the Drop-in UI, you'll need to
get a tokenization key from the Control Panel
or you can
generate a client token
on your server.
Requirements
- Xcode 12+
- A minimum deployment target of iOS 12.0
- Swift 5.1+ (or Objective-C)
Setup
Drop-in requires a minimum deployment target of iOS 12+ and Xcode 12+. There are several ways to
include Braintree's Drop-in in your project.
Swift Package Manager
To add the BraintreeDropIn package to your Xcode project, select
File > Swift Packages > Add Package Dependency and enter
https://github.com/braintree/braintree-ios-drop-in
as the repository URL. Tick the checkbox for BraintreeDropIn. If you look at your app target, you
will see that the BraintreeDropIn library is automatically linked as a framework to your app (see
General > Frameworks, Libraries, and Embedded Content).
CocoaPods
- Ruby
pod 'BraintreeDropIn'Client-side implementation
Import BraintreeDropIn
Add the following import statement to any class using Braintree.
- Swift
import BraintreeDropInStarting Drop-in
Starting July 14, 2025 the Drop-in SDK will move to a deprecated status and we will no longer make any updates to this SDK. Processing will be supported for 1 year after the deprecation date, but you should upgrade immediately to avoid any disruption.
Starting July 14, 2026 the Drop-in SDK will move to an unsupported status and will no longer supported by Braintree developers or Braintree Support. Processing for unsupported SDKs can be suspended at any time.
Please migrate to the Braintree SDK to continue processing and receiving updates.
- Swift
func showDropIn(clientTokenOrTokenizationKey: String) {
let request = BTDropInRequest()
let dropIn = BTDropInController(authorization: clientTokenOrTokenizationKey, request: request) { (controller, result, error) in
if (error != nil) {
print("ERROR")
} else if (result?.isCanceled == true) {
print("CANCELED")
} else if let result = result {
// Use the BTDropInResult properties to update your UI
// result.paymentMethodType
// result.paymentMethod
// result.paymentIcon
// result.paymentDescription
}
controller.dismiss(animated: true, completion: nil)
}
self.present(dropIn!, animated: true, completion: nil)
}Configuring payment methods
Additional steps are required for the Drop-in UI to accept payment methods other than cards. After
completing the
Drop-in setup instructions, follow the steps below for each payment method
type.
PayPal
In order for your Drop-in to support PayPal payments, you must complete the full
PayPal integration.
Venmo
To support Venmo payments in the Drop-in UI, make sure to follow the app switch setup instructions
in the
Client SDK Setup
guide and complete the full
Venmo integration. Venmo also requires version
4.29.0 or higher of the Braintree iOS SDK.
Apple Pay
If you've included the Apple Pay pod or framework in your project, Drop-in will show Apple Pay as a
payment option as long as you've completed the
Apple Pay integration
and the customer's
device and card type are supported.
BTApplePayClient to tokenize the customer's Apple Pay information, and
see our Apple Pay Guide
for more information.
Conditionally disabling payment methods
Once you have enabled PayPal, Venmo, or Apple Pay, you have the option to conditionally hide these
payment methods from your checkout.
PayPal
- Swift
let request = BTDropInRequest()
request.paypalDisabled = trueVenmo
- Swift
let request = BTDropInRequest()
request.venmoDisabled = trueApple Pay
- Swift
let request = BTDropInRequest()
request.applePayDisabled = true3D Secure
Drop-in supports
3D Secure 2 verification. To use 3D Secure
in your integration, make sure app switch is
set up
and then follow our
implementation guide. Once you
have added 3D Secure to Drop-in, you will need to complete the
server-side implementation for 3D Secure.
Displaying the most recently added payment method
If your user already has an existing payment method, you may not need to show the Drop-in payment
picker. You can check if they have an existing payment method using
BTDropInResult:mostRecentPaymentMethod. A payment method will
only be returned when using a client token created with a
customer_id.
- Swift
BTDropInResult.mostRecentPaymentMethod(forClientToken: clientToken) { result, error in
if (error != nil) {
print("ERROR")
} else if let result = result {
// Use the BTDropInResult properties to update your UI
// result.paymentMethodType
// result.paymentMethod
// result.paymentIcon
// result.paymentDescription
}
})Location Permissions
The Braintree iOS SDK uses device and browser location data for fraud detection when available (i.e.
when location permissions have already been requested by your app and granted by the user). While
you do not need to request location data from users in order to use Braintree, Apple requires a
NSLocationWhenInUseUsageDescription key in your Info.plist if
your app contains code referencing location APIs. If your app does not request location data, you
will still need to include a
NSLocationWhenInUseUsageDescription plist entry.
Next steps
- Read the Set Up Your Server guide to learn about our server SDKs and how to send a nonce to your server
- Explore the ways to customize the appearance and functionality of Drop-in
- Learn how to manage different payment methods