venmo / venmo-ios-sdk

Make and accept payments in your iOS app via Venmo
MIT License
178 stars 57 forks source link

Venmo app crashes with VENTransactionMethodAppSwitch #69

Closed conradev closed 8 years ago

conradev commented 9 years ago

Running this code

Venmo *venmo = [Venmo sharedInstance];
venmo.defaultTransactionMethod = VENTransactionMethodAppSwitch;
[venmo sendRequestTo:@"(415) 555-1234" amount:0 note:@"" audience:VENTransactionAudienceUserDefault completionHandler:nil];

which translates to opening this URL

venmosdk://venmo.com/?client=ios&app_name=Workflow&app_id=1809&device_id=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&amount=&txn=charge&recipients=(415)%20555-1234&note=&app_version=1.0.0

causes the Venmo app to crash (report) with the following syslog:

Venmo[11407] <Error>: -[NSNull floatValue]: unrecognized selector sent to instance 0x19321a6e0
Venmo[11407] <Error>: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull floatValue]: unrecognized selector sent to instance 0x19321a6e0'
    *** First throw call stack:
    (0x181e59e48 0x1925980e4 0x181e60f14 0x181e5dcc4 0x181d62c1c 0x1000ebf40 0x1000e8f0c 0x10006fc64 0x18689754c 0x186891524 0x1868939b0 0x186892048 0x18a0b5640 0x181e12124 0x181e1122c 0x181e0f850 0x181d3d1f4 0x18667378c 0x18666e784 0x10006cb9c 0x192c06a08)
eliperkins commented 9 years ago

Heh. Nice find! This will be fixed in the upcoming version of Venmo, and we'll work to fix it in the SDK as well so that these attributes aren't serialized into the URL in a funky way like this.

conradev commented 9 years ago

Awesome, thanks! :+1:

eliperkins commented 8 years ago

This fix should have gone out ages ago. Feel free to reopen this issue should it persist!