Google Plus share in a popup

2019-01-31 08:55发布

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?

标签: google-plus
3条回答
趁早两清
2楼-- · 2019-01-31 09:33

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楼-- · 2019-01-31 09:46

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.

查看更多
放荡不羁爱自由
4楼-- · 2019-01-31 09:48

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

查看更多
登录 后发表回答