#kasey-iOS
1 messages · Page 1 of 1 (latest)
I am not really asking about a specific error message. More of a user experience, a user is logged in until they decide to log out (which most likely will rarely occur). A user then can load the app, which triggers loading the CustomerContext and PaymentContext. I'm wondering when the createCustomerKey method is triggered? I want to provide the most seamless user experience possible, so if we cannot get a customer key, we can simply say that due to being offline we are unable to load certain information. When the user then goes to pay or anything without an ephemeral key, can we trigger this on demand when a network connection is present again?
Hi looking at this code https://github.com/stripe/stripe-ios/blob/master/Stripe/STPEphemeralKeyManager.swift, the createCustomerKey will be called when the ephemeral key doesn't exist or expires.
Hmm and it looks like there is a var performsEagerFetching , but say a key is never loaded or it is expired, I assume the API does not continuously fetch for a new one. Is there a time interval that has to pass by before we can get this value?
The SDK will invovke createCustomerKey() as when it needs it, and I don't think you need to worry about the detailed implementation here.
I'd suggest to present a message or even disable the payment button when the user is offline, and remove the message/enable the button when back to online.
For sure, this makes sense. My main concern was loading the payment methods but maybe I need to do some more exploration locally on this. I appreciate the insight, thank you!