stripe-ios icon indicating copy to clipboard operation
stripe-ios copied to clipboard

watchOS 3.0 support

Open keith opened this issue 9 years ago • 16 comments

Hey everyone,

Just wondering if watchOS 3.0 support (specifically around the new ApplePay API) is planned? Internally we've adapted the SDK to make it work, but it required us to remove a lot of iOS SDK specific UI code that I guess might ideally be broken out into a different subspec.

Just wondering if we should continue down this path, or if support is forthcoming. Thanks!

keith avatar Aug 08 '16 18:08 keith

I wanted to create dedicated issue, but it looks like this ticket is a good place to mention another issue:

I'm developing new iMessage app with ApplePay and I wanted to use Stripe. However, I was not able to compile it because it uses a handful of "non extensions safe" APIs.

I'm +1 for separate podspec for non-UIKit / non-UIApplication core of the SDK.

delebedev avatar Aug 10 '16 10:08 delebedev

Hey @keith @garnett - we're working on a fix for you guys here. Sorry for the trouble; we hope to have something in the next week or two.

jflinter avatar Aug 12 '16 07:08 jflinter

Any news on this feature? We are running into a similar problem where we want to use the Stripe pod in an app extension and are getting a build error from the usage of [UIApplication sharedApplication].

eliasbagley avatar Aug 29 '16 18:08 eliasbagley

Hi @eliasbagley,

Thanks for following up. We're aware of the issue but we don't have a specific timeline right now. We'll update this thread when we have further updates.

bdorfman avatar Aug 29 '16 18:08 bdorfman

@garnett @eliasbagley I just released version 9.0.0 of the sdk, which should now be able to be linked against app extension targets (although not all of our prebuilt view controllers will work in all types of extensions).

@keith We're still considering how best to support watchOS. We don't currently have a timeline on adding a watch framework target, so for now maintaining your own fork might be best.

bdorfman avatar Oct 05 '16 18:10 bdorfman

Any word on when this might happen? I'd love to be able to support watchOS without insanely hacky workarounds.

designatednerd avatar Apr 19 '17 21:04 designatednerd

FWIW we'd be happy to open-source our fork of the SDK, we just didn't initially because not all of the APIs are documented (even if the public SDK uses the same APIs).

@bdorfman if you guys are cool with it then we can look into this so others can benefit from that work as well.

sberrevoets avatar Apr 19 '17 21:04 sberrevoets

I think we would rather not have a competing public fork of the SDK, but if you want to send us a pull request that has tweaks to add WatchOS support we would look at it. I'm not 100% clear on what exactly is necessary to support the watch, other than a new framework target that excludes all the iOS-specific UI classes. We don't currently have any plans to add WatchOS support in the near future.

Happy to chat about it with you directly over email @sberrevoets if that is easier.

bdorfman-stripe avatar Apr 19 '17 21:04 bdorfman-stripe

I used the word 'fork' a bit loosely here, in that it's not really a fork at all 😄

We wrote a very barebones library (in Swift) that reimplemented only the pieces we needed (creating tokens for regular credit cards and Apple Pay cards) using the official SDK as a reference. All the UI pieces, bank accounts integration, etc. are not implemented so anyone looking for that would still need to use the official SDK.

The initial approach was for us to remove the UI specific code from the official SDK, but then the watchOS Apple Pay APIs were slightly different from the iOS ones so there was more work needed there. At that point we decided it would probably take less time to just reimplement the 2 things we needed instead.

My inbox scott @ lyft is open too if you want to take this offline :)

sberrevoets avatar Apr 19 '17 21:04 sberrevoets

Hey @designatednerd,

I worked a bit on getting the Stripe SDK building on watchOS. I have a branch with a watch framework target that basically only includes the API bindings and leaves out all the iOS-specific UI components. Would you mind taking a look at it and telling me if it fits your needs? I haven't built any watch apps myself and I want to make sure this is the right level of support people would want from a watch Stripe framework before proceeding too much further.

You can find the branch here: https://github.com/stripe/stripe-ios/tree/bdorfman-watchos

Thanks in advance! Brian

bdorfman-stripe avatar Apr 24 '17 17:04 bdorfman-stripe

Thanks @bdorfman-stripe! For the most part this looks good, and philosophically only including the API bindings makes sense.

A few issues I see here:

  • The podspec has not yet been updated on your branch - do you want to try to set that up or should I try to get it set up locally to test this out?
  • You've got some build warnings whining that OSSpinLock is deprecated on watchOS when you build the watchOS framework target (at least with the scheme that is locally generated - you may want to share the build scheme for the framework target). I assume that from a business standpoint, Stripe wants to keep the analytics stuff calling into STPAspects - if that's the case I thinnnnk you can probably conditionally compile that stuff out to use non-deprecated API.
  • Probably want to bump the supported version down from 3.1 to 3.0 - doesn't seem like that causes any build issues, at least.
  • I believe you will need to link Foundation and PassKit frameworks in order to get all of this to work on device - those are linked to the main SDK but there's separate implementations on watchOS.

More on the enhancement side, it's relatively non-hideous to create a single set of code that can be used to generate different frameworks per platform but with the same name. Definitely not a huge priority on my end but probably easier for most users.

Thank you very much for the quick response!

designatednerd avatar Apr 24 '17 17:04 designatednerd

Yes I haven't done all the work to make this ready to ship, just did a quick first pass as a proof of concept to see if this was actually what people needed. Thanks for looking it over.

bdorfman-stripe avatar Apr 24 '17 17:04 bdorfman-stripe

@bdorfman-stripe Wee check-in to see if you've been able to make any progress on this or if you would like some help making progress on this.

designatednerd avatar Jun 22 '17 13:06 designatednerd

I would very much be interested in this - we're working on a potential watch app that would be leveraging payment.

welshm avatar Apr 04 '18 14:04 welshm

It seems like this isn't something that's going to be supported

keith avatar Aug 18 '19 06:08 keith

Reopening this to track watchOS support, though we still don't have a timeline for it. The StripeApplePay SDK module would be a good starting point, but we need to clean up a few references to UIDevice.current.systemVersion and such.

davidme-stripe avatar Apr 18 '22 23:04 davidme-stripe

Any movement on this?

Would love to be able to pay in app with Stripe using the watch companion app, just like Apple Pay.

Great starting point is right, @davidme-stripe

raymondwelch33 avatar Nov 02 '22 13:11 raymondwelch33

Working on this: https://github.com/stripe/stripe-ios/pull/2064

davidme-stripe avatar Nov 04 '22 22:11 davidme-stripe

@davidme-stripe - you are great. Developers like you make me proud to work in this industry.

raymondwelch33 avatar Nov 05 '22 10:11 raymondwelch33

Closing, as it seems like this has been resolved. If anyone in this thread is interested in further watchOS improvements, please feel free to open a new issue!

sfriedman-stripe avatar Dec 24 '23 05:12 sfriedman-stripe