0

I need to implement data sharing feature for my app. The data type that I need to share is very specific and is not available on schema.org. This is an enterprise app and we have no need to share this data with any outside apps. I couldn't find any example or samples about how this type of data could be shared. I will really appreciate if someone can provide code sample on how this could be done.

Sushil
  • 5,265
  • 2
  • 17
  • 15
crazy novice
  • 1,757
  • 3
  • 14
  • 36
  • do you need to share data with other apps? if yes - you can share as text,html or a file. there is [good content](http://msdn.microsoft.com/en-us/library/windows/apps/hh758315.aspx) and related sample at msdn. – Sushil Jun 23 '13 at 06:28

1 Answers1

2

The custom data format string you supply is really up to you. Schema.org is mentioned because it provides an agreed-upon format for many types of data making your app more discoverable and interoperable, but in the end the schema.org url you provide as part of the sharing contract in your application manifest is just a string. You can name your format whatever you want, and as long as you make the share source and share target aware of that specific format (via the manifest) and are consistent with how you create/parse the payload it should just work.

For instance, I took the share source and share target examples from dev.windows.com and changed the custom data format id to "gggggg" and it works fine. Now, of course, any applications that originally knew how to deal with "http://schema.org/Book" (the original type used in those samples) no longer are share targets, but that's precisely what you'd want.

Jim O'Neil
  • 23,344
  • 7
  • 42
  • 67
  • Thanks Jim for your response. So there is no special need for the custom data type that need to shared? I recall seeing a sample code in c# and if I recall correct, the class has to be decorated with **DataContract** attribute. Also we need to call some special method to serialize that data first. I wonder if there is any such requirement when a custom data type need to be shared using JavaScript. – crazy novice Jun 23 '13 at 22:55
  • 1
    The data is serialized and all the samples I've seen do so as a string, so with JSON it's pretty simple in JavaScript, but with C# you'd likely have a class with a DataContract for the deserialized JSON (XML or whatever). – Jim O'Neil Jun 23 '13 at 23:11