9

Hi I am developing an app that shares a picture in via Share contract in Windows Phone 8.1. My code is

DataTransferManager dataTransferManager = DataTransferManager.GetForCurrentView();
dataTransferManager.DataRequested += new TypedEventHandler<DataTransferManager, DataRequestedEventArgs>(this.DataRequested);

and

private async void DataRequested(DataTransferManager sender, DataRequestedEventArgs args)
{
    DataRequest request = args.Request;
    request.Data.Properties.Title = "Unscramble this";
    request.Data.Properties.Description = "";
    request.Data.SetText(string.Format("Scrambled word is {0} and clue is {1}. Help me to unscramble this \r\n(via Unscramble Plus for Windows Phone)",scrambledString.ToUpper(),selectedMeanings.ToUpper()));
    DataRequestDeferral deferral = request.GetDeferral();

    // Make sure we always call Complete on the deferral.
    try
    {
        //StorageFile logoFile = await Package.Current.InstalledLocation.GetFileAsync("Assets\\Logo.png");

        StorageFile imagefile = await KnownFolders.PicturesLibrary.GetFileAsync("pic.png");
        List<IStorageItem> storageItems = new List<IStorageItem>();
        storageItems.Add(imagefile);
        request.Data.SetStorageItems(storageItems);
    }
    finally
    {
        deferral.Complete();
    } 
}

where this show the share contract as below (including only Facebook, Mail apps) enter image description here

But if you see in Sendtiment app for Windows Phone (http://www.windowsphone.com/en-us/store/app/sendtiment-cards/9c389cc5-5c00-4f8e-8bd4-e6fbb5040c24) it shows many apps like Viber, Whatsapp, Twitter.

enter image description here

How to get these Viber, Whatsapp like apps in my app's share contract?

Edit: (Addition) When I remove request.Data.SetText(string.Format("Scrambled word is {0} and clue is {1}. \r\n(via Unscramble Plus for Windows Phone)",scrambledString.ToUpper(),selectedMeanings.ToUpper())); line, this shows OneDrive.

enter image description here

Isham Mohamed
  • 2,629
  • 1
  • 14
  • 27
  • I guess only the photos and videos are possible to share: Have a look at theses: http://stackoverflow.com/questions/23283472/windows-phone-8-media-chooser-photo-and-video-similar-to-viber-whatsapp http://stackoverflow.com/questions/21146271/share-content-via-whatsapp-in-wp8-apps – Kulasangar Aug 18 '14 at 13:32
  • @Kulasangar what I am trying to share is an IMAGE.. your comment is helpless for me. – Isham Mohamed Aug 18 '14 at 13:43
  • You testing this on Device or emulator? – Harshit Nov 18 '14 at 12:18
  • Any chance somebody got a solution for this problem(Is this a problem with the winrt based apps)? – AbsoluteSith May 26 '15 at 14:20

2 Answers2

0

http://channel9.msdn.com/Series/Building-Apps-for-Windows-Phone-8-1/10

this might help, also make sure what kind of data you are sharing, as the app will show only if the Content type matches,

for example whatsapp will show only if you are sharing Video,Images but NOT phone contact.

Harshit
  • 661
  • 5
  • 16
-3

if you use a Universal-App, Whatsapp will not shown. WhatsApp is a WP8.1 Silverlight-App. This is the Problem!

Flo
  • 2,232
  • 2
  • 11
  • 18