Austin
Austin

Reputation: 335

How to send/share data between an Electron app and UWP app

I have a usecase where I need to be able to send data (images and maybe some json metadata) from an electron app to a UWP (gamebar) app.

The obvious answer to this would seem to be writing data to a local file on disc from Electron, and reading it from the UWP app. The issue I'm having there is that even with <rescap:Capability Name="broadFileSystemAccess"/> enabled in my UWP app, the user would have to explicitly enable file access for this app in their Windows settings in order for my UWP app to be able to read a file from an arbitrary location on disc.

Is there a way to have inter-process communication between the apps to get around this issue?

Upvotes: 0

Views: 149

Answers (1)

Roy Li - MSFT
Roy Li - MSFT

Reputation: 8681

You could try to save the file into the Document library which is enabled by default as long as you added the documentsLibrary capability in the manifest file.

       StorageFolder folder = KnownFolders.DocumentsLibrary;
       StorageFile file = await folder.GetFileAsync("paris.png");

If you don't want to use file system to do the IPC, you might need to check other ways here: UWP-ipc

Upvotes: 1

Related Questions