I want to integrate venmo library for payment into an iOS app.
I created a demo of it by following venmo github project.
As per the description on github project below is the code to display venmo app/open venmo in browser:
- (IBAction)payButtonPressed:(UIButton *)sender
{
// App crashes here. Does not crash if I comment this line.
venmoClient = [VenmoClient clientWithAppId:AppId secret:AppSecret];
VenmoTransaction *venmoTransaction = [[VenmoTransaction alloc] init];
venmoTransaction.type = VenmoTransactionTypePay;
venmoTransaction.amount = [NSDecimalNumber decimalNumberWithString:@"5"];
venmoTransaction.note = @"Payment for something";
venmoTransaction.toUserHandle = @"Name";
VenmoViewController *venmoViewController = [venmoClient viewControllerWithTransaction:
venmoTransaction];
if (venmoViewController) {
[self presentViewController:venmoViewController animated:YES completion:nil];
}
}
When I run the project it crashes on first line of the method. If I comment it out then its not crashing.
Below is the error message it throws :
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSBundle name]: unrecognized selector sent to instance 0x17556e00'
Has anyone used venmo?
Update : I downloaded project from venmo-ios-sdk. Opened sample project and tried to run. But it does not even compile.
Also then I tried to create a new demo by adding venmo ios sdk. As per the gihub readme file, I have to add
pod 'venmo-ios-sdk', :git => 'https://github.com/venmo/venmo-ios-sdk'
to Podfile. But it throws error :
[!] The name of the given podspec
Venmo-iOS-SDK
doesn't match the expected onevenmo-ios-sdk
Then I tried adding
pod 'Venmo-iOS-SDK', :git => 'https://github.com/venmo/venmo-ios-sdk'
and it allowed to install.
Now, as per the tutorial there are 2 ways to send payment.
- Switching to the Venmo app : Trying this throws error
Transaction failed with error: The current session is not open.
- Using the Venmo API : This throws
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Venmo handleOpenURL:]: unrecognized selector sent to instance 0x8e8a410'
. This is clear because there is no such method implemented in Venmo.m file. But it is declared in Venmo.h file.