Is there any method to share text from mobile web to wechat by sharing button? - mobile-website

I am looking for wechat sharing function like how whatsapp does.
href="whatsapp://send?text=http://www.example.com"
Based on my research, most of them will be encoded in QR code and scan the QR code with wechat scanner. Is there a way to share the text directly to friend when click on sharing button just like how whatsapp does?

Wechat doesn't have any official deep linking URL for sending a text. However, if you can add some JavaScript Code in your mobile web, you can achieve the share functionality.
Check out Send to chat documentation on Wechat JS SDK.
From JS SDK Documentation:-
wx.onMenuShareAppMessage({
title: '', // Sharing title
desc: '', // Sharing description
link: '', // Sharing link
imgUrl: '', // Sharing image URL
type: '', // Sharing type, such as “music”, “video “ or “link”. It is “link” by default.
dataUrl: '', // The data URL should be provided for items of type “music” or “video”. It is null by default.
success: function () {
// Callback function executed after a user confirms sharing
},
cancel: function () {
// Callback function executed after a user cancels sharing
}
});
We do have some unofficial deep linking URL like you mentioned. But it may stop work anytime if Wechat decided to change it.
Here is some of them below, sadly I don't know any URL to share a text to chat.
weixin:// - to open Wechat app (if installed)
weixin://dl/chat - to open chat screen of Wechat
weixin://dl/moments - to open user moements
weixin://dl/profile - to open user profile
weixin://dl/settings - to open settings page

Related

Flutter firebase dynamic link social tags info not showing at all

I have the below code which does generate the dynamic link correctly. However, when I share the link using Share plugin I just see the link text. Nothing else appears in the shared message. None of the social tags attributes are shown when the link is shared.
Second thing, the link also does not open in the browser - it always tries to find the app on google play store. My app isn't on the play store yet and I want it to always point to browser. The dynamic link I configured on playsore does open in the browser but the links created via code go to the play store - always. The DL I configured also does NOT show any social media info.
final DynamicLinkParameters parameters = DynamicLinkParameters(
uriPrefix: 'https://zakaas.page.link',
link: Uri.parse("https://firebasestorage.googleapis.com/v0/b/removed_strage/o/UserVideos%2F2020-06-21%2017%3A42%3A54.530730.mp4?alt=media&token=removed_token_value"),
androidParameters: AndroidParameters(
packageName: 'com.clidio.zakaas',
minimumVersion: 21,
),
navigationInfoParameters: NavigationInfoParameters(
forcedRedirectEnabled: false,
),
dynamicLinkParametersOptions: DynamicLinkParametersOptions(
shortDynamicLinkPathLength: ShortDynamicLinkPathLength.short,
),
socialMetaTagParameters: SocialMetaTagParameters(
title: 'Example of a Dynamic Link',
description: 'This link works whether app is installed or not!',
),
);
final Uri dynamicUrl = await parameters.buildUrl();
final ShortDynamicLink shortenedLink = await DynamicLinkParameters.shortenUrl(
dynamicUrl,
DynamicLinkParametersOptions(shortDynamicLinkPathLength: ShortDynamicLinkPathLength.unguessable),
);
Share.share('${shortenedLink.shortUrl}', subject: '${shortenedLink.shortUrl}');
OK. After a simple thought, I got this working now. I used a social app "HIKE" when I was testing and unfrtunately it did not work on hike. I don't use whatsapp for >2 years now but then I gave a try on friend's whatsapp and it did work . It shows image as well.
Thank you

Facebook Open Graph - Share Dialog not appearing from Facebook Application

Implementing Share feature on web application.
While the code below works with your favorite desktop and mobile browsers (Share Dialog shows up when clicking on the Share button), it wont work (the Share Dialog doesn't show up) when the web application is opened via Facebook Android Application (by clicking the Website URL from a post and it open's up from the website)
FB.ui({
method: "share_open_graph",
action_type: "og.shares",
action_properties: JSON.stringify({
object: {
"fb:app_id": "my_app_id",
"og:url": "url_of_my_app",
"og:title": "my_app_title",
"og:description": "my_app_desc",
"og:image": "display_image",
"og:image:width": "600",
"og:image:height": "350"
}
})
}, function (response) {});
Rule of thumb when using FB.ui is to not use FB.ui inside a Promise success callback. Facebook Application is blocking pop-ups when called inside a successful return of Promise.

How To Share Text in Social Networks on FirefoxOS

I'm developing an app for FirefoxOS. This app needs a button that, when pressed, shares some text in social networks and email.
I'm using this code I found somewhere:
var share = document.querySelector("#share");
if (share)
{
share.onclick = function ()
{
var sharing = new MozActivity({
name: "share",
data:
{
//type: "url", // Possibly text/html in future versions,
number: 1,
url: "http://robertnyman.com"
}
});
}
}
It kind of works and I successfully shared pictures. This code opens a menu with all the apps that are available for sharing (Facebook, Twitter, etc). Then you can select any app and it will open that app with an empty textfield that the user can fill with text to share. But I cannot share predefined text at all. I cannot pass this predefined text to the other apps.
As you can see, there's a type parameter that's commented and it says that it'll be available in future versions.
Do you guys have any idea of how to include text in the data variable (or somewhere else) so it can be shared?
Thanks everyone!
I am not sure the Twitter Firefox OS App has a field for the text for the share activity. Another option is to compose the twitter URL and then open it. For example:
var twitterURL = encodeURI("https://twitter.com/intent/tweet?text=test tweet");
var openURL = new MozActivity({
name: "view",
data: {
type: "url",
url: twitterURL
}
})

Facebook API: Can't have the send dialog working. Why?

I am trying to send a message to a user through private inbox with Phonegap and the phonegap facebook plugin through this functionality:
https://developers.facebook.com/docs/sharing/reference/send-dialog
So when doing this :
FB.ui({
app_id:'XXXXXXXXX',
method: 'send',
name: "This is the name",
link: 'www.google.com',
to:to,
description:'This is the description'
});
as stated in this link : Send private messages to friends
Nothing happen. Why ?
Is it supported by the plugin ?
Please help.
Thanks
I am trying to implement the private message function in phonegap build, but it seems like its only working on desktop not in mobile device.
when I change the method from send to feed, and indicate display to touch.
It works on my IOS build, the window just popup
FB.ui({
app_id:'XXXXXXXXX',
method: 'feed',
link: 'www.google.com',
to:to,
display: touch
});
However, its not working any more when I change the method back to send.
I believe facebook api don't support FB.UI send method in mobile devices, just like what they already mentioned on their page: https://developers.facebook.com/docs/sharing/reference/send-dialog
"This dialog can be used with the JavaScript SDK and by performing a full redirect to a URL. It is not supported on mobile devices."
I STILL DON'T KNOW HOW TO SEND PRIVATE MESSAGE THROUGH FACEBOOK NOW, GOOD LUCK

How do I detect if the Facebook Send Dialog is available?

The send dialog is a useful piece of functionality.
Sadly it is not available on mobile devices
I call the api in the following way;
app.sendMessage = function(){
FB.ui({
app_id: app.facebook_app_id,
method: "send",
link: "http://google.com"
});
};
Right now the outcome on a mobile device is a nasty error page.
Is there a way to detect in javascript whether or not the send dialog is available?
I'd suggest something like;
function sendDialogAvailable(){
return FB.supports("senddialog");
}
I could then change my app's functionality according to this property, but right now I fear I'll have to resort to browser sniffing.