问题
I am trying to do the payment using https://www.balancedpayments.com/ . They have their iPhone library for this https://github.com/balanced/balanced-ios . The problem is that there is not enough documentation on how the Balanced.framework has to be added in the XCode 4.5 project?
回答1:
- Download the Balanced framework.
- Add Balanced.framework to your project and to Build Phases -> Link Binary With Libraries.
- Add CoreTelephony.framework to Build Phases -> Link Binary With Libraries.
Usage:
#import <Balanced/Balanced.h>
Balanced *balanced = [[Balanced alloc] initWithMarketplaceURI:@"/v1/marketplaces/TEST-MP2autgNHAZxRWZs76RriOze"];
BPCard *card = [[BPCard alloc] initWithNumber:@"4242424242424242" expirationMonth:8 expirationYear:2025 securityCode:@"123"];
If you need more help, look at the example project they have attached...
回答2:
You Just Need to add those Balanced- Classes as a static library, It will work out.
Add a Static Library to your Project. Now add those balanced classes to your static Library.
Goto YourProject->Target->BuildPhases->LinkWithBinaryLibraries Here add the StaticLibrary.
Hope this will help you.
回答3:
Follow this issue on Github. The lack of linking Balanced.framework is related to Xcode templates. The fix is documented in the project's "Contributing" section. You need to build it.
回答4:
The balanced-ios project has changed quite a bit since this question was asked. It now creates a static library instead of a framework. This change was made for the reasons described in balanced-ios Project Architecture.
To integrate balanced-ios into iOS projects, do the following:
- Download the latest pre-built release zip from https://github.com/balanced/balanced-ios/releases
- Copy balanced.a to your project
- Add balanced.a to Build Phases -> Link Binary With Libraries
- Add CoreTelephony.framework to Build Phases -> Link Binary With Libraries
- Copy includes/balanced to your project's include folder (or create an include folder and copy includes/balanced to it) includes is automatically included in header search paths. Drag includes to your project so you can see the files from there. If you copy the include files to a location other than includes you'll probably need to add the path to User Header Search Paths in your project settings
Code usage examples can be found in the README at https://github.com/balanced/balanced-ios
来源:https://stackoverflow.com/questions/16786283/balanced-payment-integration-for-ios