
StorageFile sampleFile = await sharedDownloadsFolder.GetFileAsync("dataFile.txt") Read the first line of dataFile.txt in Publisher Cache folder Downloads StorageFile sampleFile = await sharedLocalFolder.CreateFileAsync("dataFile.txt") Īwait FileIO.WriteTextAsync(sampleFile, "My text") StorageFolder sharedDownloadsFolder = ("Downloads") Create dataFile.txt in Publisher Cache folder Downloads and write “My text” to it You can then use StorageFolder.CreateFileAsync and StorageFolder.GetFileAsync to write and read files. To read or write files from a Publisher Cache folder, you must use the GetPublisherCacheFolder and pass the folder name as a parameter you will get back a StorageFolder. Remember, you need to do this from every app that wants access to the shared folders. You need to call out any folder or folders you will be accessing in this case we just have one called Downloads.

The first thing you need to do to enable Publisher Cache is to have the following declaration to every app that wants to participate in the data sharing: Note that in contrast to Shared Local this feature keeps data inside the user boundary Publisher Cache shares data across apps for the current user.

Sharing local data across appsĪ new Windows 10 feature to share data is Publisher Cache, which allows two or more apps from the same publisher to share user data. We’ll cover how to share data across apps of the same publisher and data shared across multiple users of an app. These mechanisms are the subject of this post. Fortunately, the Universal Windows Platform provides mechanisms to get around the sandbox if the scenario requires it. This app data container is within the app sandbox, which means no other app or user will be able to access it. When an app is installed, the system creates a per-user app data container on the device.


In this post we will be looking at how that local data can be shared, both between apps and users. In the first installment of this blog series we looked at the various options at your disposal to store your app’s local data.
