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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top