Google Plus share in a popup

喜夏-厌秋 提交于 2020-01-10 07:10:49

问题


I'm trying to build a Google+ share feature on a website just like the one you see on questions here at stackoverflow. When you click that Google+ button an a question it opens a new window to a URL like this: https://plus.google.com/share?url=http://www.stackoverflow.com

I've experimented with this and found that for some reason it only works for a few domains, including stackoverflow.com. For example google.com: https://plus.google.com/share?url=http://www.google.com or eff.org: https://plus.google.com/share?url=https://www.eff.org

Other domains like: https://plus.google.com/share?url=https://www.cnn.com or: https://plus.google.com/share?url=https://www.revision3.com just redirect to my Google+ homepage.

What am I missing here? Why do some domains work and others don't? Is there some metadata present on the pages that work that is missing from the ones that don't? Or perhaps those domains that work were added to some Google+ beta program that I'm not aware of?


回答1:


It looks like the new share URL is live now for all domains. The mobile 'hack' no longer appears to work, but something like this: https://plus.google.com/share?url=http://favo.rs does




回答2:


Update: While still not officially supported by the Google+ platform the share URL does now work for all domains.

https://plus.google.com/share?url=http://example.org


It is probably a limited rollout with a few specific partners. The share URL has not publicly been announced as a supported feature by Google.

Google+ feature requests:

https://code.google.com/p/google-plus-platform/issues/detail?id=50

https://code.google.com/p/google-plus-platform/issues/detail?id=153




回答3:


I personally suggest Google Plus Interactive Posts button https://developers.google.com/+/web/share/interactive to use in your apps/websites.Here Google Plus allows many customizations to do according to the requirement. I have used it in my app. Its a better option than Share button.



来源:https://stackoverflow.com/questions/9022416/google-plus-share-in-a-popup

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!