mike4aday / SwiftlySalesforce

The Swift-est way to build native mobile apps that connect to Salesforce.
MIT License
136 stars 43 forks source link

Transition to SafariWebView if the identity method is offline #60

Closed daichi1021 closed 6 years ago

daichi1021 commented 6 years ago

If an error occurs in the identity method, it becomes uniform RequestError.userAuthenticationRequired, so if you call it with the iPhone offline, it will transition to SafariWebView.

mike4aday commented 6 years ago

@daichi1021 is this specific to the identity call? Any method in the Salesforce class should act the same way, no?

Can you post some code showing the issue?

The user should not be redirected to the Salesforce authentication form unless request to Salesforce returns a HTTP response code of 401. If the user is offline, then a call to a Salesforce method would throw a different error.

Thanks

daichi1021 commented 6 years ago

@mike4aday

thank you for your answer.

I feel that there is a problem unique to the salesforce.identity method. For example, if you call the salesforce.apex method offline, an offline error will be returned, but if it is salesforce.identity it will transition to SafariWebView.

This is reproduced also when you exchange identity and apex in the same process.

mike4aday commented 6 years ago

@daichi1021 thanks for the follow-up. I'll check into this as soon as I can.

mike4aday commented 6 years ago

Thank you again, @daichi1021 - I could reproduce this and it's a bug. I'll fix it soon.

mike4aday commented 6 years ago

Fixed with version 6.0.5. Thank you @daichi1021