首页 > 解决方案 > GTMAppAuth 抛出错误«无法打开 Safari»

问题描述

我正在尝试通过 Cocoapods 将 GTMAppAuth 实现到我的应用程序中。

但是当我尝试用这个开始这个过程时:

appDelegate.currentAuthorizationFlow = [OIDAuthState
    authStateByPresentingAuthorizationRequest:request
    externalUserAgent: userAgent
    callback:^(OIDAuthState * _Nullable authState, NSError * _Nullable error) { … }

我收到一条错误消息unable to open Safari

我在互联网上找不到任何可以告诉我为什么会发生此错误的内容。

我确实在 info.plist 中设置了 URL 方案。

有任何想法吗?

[编辑]

我想提一下,框架附带的示例似乎是错误的,或者至少已经过时了。我只能使用OIDAuthState authStateByPresentingAuhtorizationRequest: externalUserAgent: callback-但在示例中他们使用的是OIDAuthState authStateByPresentingAuthorizationRequest: callback:或者OIDAuthState authStateByPresentingAuthorizationRequest: presentingViewController: callback-我无法在我的代码中访问它们。

标签: iosobjective-cxcode

解决方案


推荐阅读