stripe / stripe-ios

Stripe iOS SDK
https://stripe.com
MIT License
2.13k stars 984 forks source link

iOS7 Crash #81

Closed huguesbr closed 10 years ago

huguesbr commented 10 years ago

Is this example suppose to support iOS7?

It crash on https://github.com/stripe/stripe-ios/blob/master/Example/StripeExample/ViewController.m#L55 as it try to do

 PKShippingMethod *shippingMethod = [PKShippingMethod summaryItemWithLabel:@"Llama Express Shipping" amount:[NSDecimalNumber decimalNumberWithString:@"20.00"]];
 [paymentRequest setShippingMethods:@[shippingMethod]];

and shippingMethod is nil because PKShippingMethod is iOS8 only

jflinter commented 10 years ago

The example is designed to support iOS7 - sorry about that. I've fixed this in 777cda06f8e0a02595eebb7fa2efe22cbf77d723.

huguesbr commented 10 years ago

hey @jflinter cool, I haven't read the full commit but it look like you're still using PKShippingMethod directly, which is iOS8 only... https://developer.apple.com/library/IOs/documentation/PassKit/Reference/PKShippingMethod_Ref/index.html

jflinter commented 10 years ago

Yeah, but I moved it back inside the canSubmitPaymentRequest: block, so it'll never get actually executed on a pre-iOS8 device.

huguesbr commented 10 years ago

oh yeah, got it

indoracer commented 9 years ago

I'm seeing this crash too using your latest SDK on a Swift app. Our deployment target is iOS 7 and we are seeing the crash when running iOS 7 (not 8). The crash (EXC_BAD_ACCESS) happens at: if test != nil or whenever I next access test

    let test = Stripe.paymentRequestWithMerchantIdentifier(Constants.ApplePayMerchantID)

    if test != nil {
        println("not nil")
    }