paypal / paypal-here-sdk-ios-distribution

Add credit card (tap, insert, swipe & key-in) capabilities to your iOS app
Other
81 stars 91 forks source link

How to handle refresh url event? #338

Open DowsingUK opened 3 years ago

DowsingUK commented 3 years ago

I'm trying to initializeMerchant after successfully initialized it a day ago then I've got this error which is pretty normal given the token expiration

PayPalRetailSDK.initializeMerchant(withCredentials: sdkCreds) { (error, merchant) in

if let err = error 
{
   err.message! --> this error:
        [Client] Updating selectors after delegate removal failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The 
        connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo=. 
        {NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was 
        invalidated.}
       Could not initialize merchant with token
} 
else
{
     self.merchantInitialized = true
}

}

self.merchantInitialized never sets to true but I keep seeing this in the console:

Successfully refreshed token.

{ "address": { "locality": "San Jose", "street_address": "1 Main St", "region": "CA", "country": "US", "postal_code": "95131" }, ...

Is there a function to listen for this Successfully refreshed token?