Mitesh Khatri
Mitesh Khatri

Reputation: 3955

Use of unresolved identifier 'Braintree'

I am using the braintree using the cocoapods in my swift ios application. I successfully installed the braintree in my ios app. my pod file structure is:

target 'appName' do
pod 'GoogleMaps'
pod 'GooglePlaces'
#  use_frameworks!

pod 'AFNetworking', '~> 2.6.0'
pod 'CardIO'
pod 'NSURL+QueryDictionary', '~> 1.0'
pod 'PureLayout'
pod 'FLEX'
pod 'InAppSettingsKit'
pod 'iOS-Slide-Menu'

#  pod "BraintreeDropIn", :path => "./"

#  pod 'Braintree/Apple-Pay'
pod 'Braintree/PayPal'
#  pod 'Braintree/Venmo'

end

I added below header file in bridge file:

#import "BraintreeCore.h"
#import "BraintreePayPal.h"
#import "Braintree.h"

Now when I try to use in my code it says Braintree.setReturnURLScheme("com.your-company.Your-App.payments")

Use of unresolved identifier 'Braintree'

So please suggest.

Upvotes: 2

Views: 1644

Answers (1)

Kamran
Kamran

Reputation: 15248

You don't need to import anything in bridging header file. After the installation from cocoapods, you can import it in any swift file as below,

import Braintree

And to set returnUrlScheme, you can use BTAppSwitch as below

BTAppSwitch.setReturnURLScheme("com.your-company.Your-App.payments")

Upvotes: 1

Related Questions