How to limit characters to be shared to twitter from WinJS app
NickName:Ibanez Ask DateTime:2014-05-13T22:46:59

How to limit characters to be shared to twitter from WinJS app

I have created a Windows 8.1 application in WinJS and I have some HTML content that I am sharing.

I have implemented sharing as per the MS sample app (http://code.msdn.microsoft.com/windowsapps/Sharing-Content-Source-App-d9bffd84)

The sharing works well, except if I share to the official Twitter app.

The problem is that it inserts the entire article (500 characters or more) into the text area of the Twitter flyout.

Is there anyway to limit the characters when the user chooses to share to Twitter?

The problem can be replicated by installing the MS share example app, selecting "Share HTML content" and selecting the Twitter app from the share flyout (The Twitter app needs to be installed on your PC of coarse).

Copyright Notice:Content Author:「Ibanez」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/23634547/how-to-limit-characters-to-be-shared-to-twitter-from-winjs-app

Answers
sebagomez 2014-05-13T16:29:07

The problem is that you don't know where your users will share to... you can tell the share charm what you want to share and you could shorten the text to 140 characters.\n\nUsing the Windows.ApplicationModel.DataTransfer.DataTransferManager.getForCurrentView().ondatarequested event you can set to the argument the data you want to share, but as I said, if you want to trim the message you are sharing, you're doing it for every 'shareable' app. If the user then picks Twitter or OneNote is something you wouldn't know.",


More about “How to limit characters to be shared to twitter from WinJS app” related questions

How to limit characters to be shared to twitter from WinJS app

I have created a Windows 8.1 application in WinJS and I have some HTML content that I am sharing. I have implemented sharing as per the MS sample app (http://code.msdn.microsoft.com/windowsapps/Sh...

Show Detail

Fetch JSON Twitter search data with WinJS

Trying to authenticate to receive search data feed from Twitter in a Windows 8 app. This is straight from a text book written when Twitter didn't require authentication so it should work although I...

Show Detail

Twitter OAuth with WinJS

Trying to authenticate with Twitter since over a week trough my Windows 8 app, but no success. My app is registered at Twitter and it should be able to read, write and sign in. I think I've trie...

Show Detail

How to list twitter tweets that are shared from Instagram app

Utilizing the Twitter search API, I'm fetching tweets from a specific Twitter account https://api.twitter.com/1.1/search/tweets.json?tweet_mode=extended&q=from%3Asweetheatmn3+filter%3Aimages

Show Detail

Latest Twitter api and 280 character limit

Twitter has recently changed the character count limit to 280 in all languages except a few ones. In our iOS app, i have upgraded the pod file to use the latest Twitter api. For composing Tweets w...

Show Detail

tweet from WinJS app

I make an app using WinJS on Windows 8 platform and I want to post a simple tweet. I can pass through all oauth authentication and I can get the request token just after user enter the PIN code. But

Show Detail

How to I add multiple distinct JSON objects into seperate lists in WinJS app?

I am trying to create a grid app with various sections and each section is being fetched to a specific listview however I have encountered a problem where you can only have one listview covering the

Show Detail

WinJS: How to limit the number of elements for the group?

How to limit the number of elements for the grouped WinJS.UI.ListView? For example, I need to output 2 columns for the group. Please note, the for horizontal and vertical orientations the number of...

Show Detail

WinJS/ Windows Phone HTML and Twitter Bootstrap

Is there a good case for trying to integrate Twitter Bootstrap (v3 RC1 at the time of writing) with a Windows Store WinJS app or even a Windows Phone HTML5 App? It strikes me that the mobile first/

Show Detail

How can I list my twitter followers list in WinJS.UI.ListView

I want to list all my twitter followers in my WinJS.UI.ListView. WinJS.xhr({ url: "https://api.twitter.com/1/followers/ids.json?cursor=-1&screen_name=" + twitterusername, ...

Show Detail