如何向用户报告来自PayPal iOS SDK的错误消息?

Cec*_*uez 9 paypal ios swift

我管理的应用程序使用了适用于iOS的PayPal SDK,这在大多数情况下都可以正常工作,除非用户尝试登录并收到错误,否则不会向用户报告错误.

例如,如果我使用不正确的登录凭据,我将收到以下错误消息:

2018-07-12 10:21:28.316449-0400 AppName[52601:6030601] PayPal SDK: Request has failed with error: invalid_user - Incorrect username/password. Please try again. (401) | PayPal Debug-ID: a1f66774362f, a1f66774362f [live, PayPal iOS SDK 2.17.0] | Details: (
Run Code Online (Sandbox Code Playgroud)

最终,当我尝试使用这些凭据登录时,它会获得此功能,然后似乎不再进一步.

func segueToConfigurePaypal(sender: UIButton?) {
    print("DEBUG Segue to configure paypal")

    let scopeValues: Set = [kPayPalOAuth2ScopeOpenId, kPayPalOAuth2ScopeEmail, kPayPalOAuth2ScopeAddress]

    let config = PayPalConfiguration()
    config.merchantName = "example"
    config.merchantPrivacyPolicyURL = URL(string: "http://www.example.com/privacy")
    config.merchantUserAgreementURL = URL(string: "http://www.example.com/terms")

    let vc = PayPalProfileSharingViewController.init(scopeValues: scopeValues, configuration: config, delegate: self)

    self.present(vc!, animated: true, completion: nil)
}
Run Code Online (Sandbox Code Playgroud)

所有这些都连接到SDK.

我想知道是否有办法制作一个事件监听器,让我知道用户登录时是否存在问题.这样一来,用户可以对他们遇到麻烦的原因有所了解,而不是认为这是一个问题与应用程序.

基本上我想要一个关于用户登录问题的警报,它会向用户报告问题.