iOS swift native 谷歌共享错误消息,因为用户必须登录

标签 ios swift

代码:

 let signIn = GPPSignIn.sharedInstance()
    signIn.shouldFetchGooglePlusUser = true
    signIn.clientID = ""
    signIn.scopes = [kGTLAuthScopePlusLogin];
    signIn.trySilentAuthentication();
    signIn.delegate = self

    let shareDialog = GPPShare.sharedInstance().nativeShareDialog()
    shareDialog.setPrefillText("Check This out")
    shareDialog.setURLToShare(NSURL(string: "https://developers.ggoe.com/+/"))
    shareDialog.open()

我正在尝试使用原生共享对话来共享内容。 我收到错误消息为 “[GPPNativeShareBuilderImpl open] 用户必须登录才能使用 native 共享框”。任何帮助都将得到赞赏。提前致谢

最佳答案

您的错误消息是您问题的答案!

[GPPNativeShareBuilderImpl open] User must be signed in to use the native share box

当我们仔细阅读时,我们可以发现您应该经过身份验证才能执行此操作。

登录后检查用户是否通过身份验证以使用方法执行此操作。

- (void) authenticate   

还建议首先阅读tutorials关于您正在使用的平台。

来自官方文档:

The native share dialog requires that you use Google+ Sign-In in your app and ensures that your visitors stay in your app in context while sharing content.

关于iOS swift native 谷歌共享错误消息,因为用户必须登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38638514/

相关文章:

ios - 在 IBOutletCollection 中设置 UIButtons 的单独标题

ios - 如何阻止iOS应用向上滚动

iphone - 为绘图应用程序实现橡皮擦功能

iphone - 在 Collection View 中加载图像的更快方法

ios - MVVM:AppDelegate 为 "ViewModel"

iphone 模型返回零?

ios - Swift Array 正在从我的数组中打印单词 "optional"不想强制解包

swift - 在第二次点击时取消选择 UICollectionView 单元格

ios - 如何在开始/完成 iOS 测试时运行/终止 shell 命令?

ios - 如何使用 CNContactPickerViewController 获取地址和联系人?