代码:
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/