简体   繁体   中英

Share Web Page information to WeChat

I am working on one of e-com application using RoR, I have to share the item page information to the WeChat window or moments whichever is possible from the web page.

Once I click the link Share to WeChat link it should open a window and ask for login or open WeChat app if in mobile and post the parameters required to post along with the WeChat sharing url in the WeChat moments.

Let's consider I have these information available;

ItemPageURL - https://my-domain/store/item.html
ItemImage - https://my-domain/store/item_img_path
ItemTitle - SomeTitle

I wanted to share these information like we do in any other Social Networking Site sharing like weibo ;

<a href="javascript:window.open('http://service.weibo.com/share/share.php?url=ItemPageURL?&pic=ItemImage&title=ItemTitle')>Share To Weibo </a>

Is there a way by which I can share these Item details from my web page to Wechat ? something like;

<ahref="javascript:window.open('http://{we_chat_sharing_url}?url=ItemPageURL?&pic=ItemImage&title=ItemTitle')> Share to WeChat</a>

WeChat works a bit different from most social networks, and doesn't have that type of sharing feature. The way most websites are handling this is different between mobile and desktop devices:

Desktop

Show a QR code with the web page's URL embedded, expecting the user to take out their phone and scan it with WeChat.

Mobile

Pop out a modal with sharing instructions (usually an arrow pointing to the top right of the screen, where the WeChat browser sharing menu is located.) Good to detect if the user is actually using the WeChat browser before doing this.

Additionally you'll also want your webpage to provide a tailored title, description and image to WeChat when sharing. Check their JS SDK for that

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM