I know that there is ApplicationData.Current.RoamingSettings, but it doesn't work and beahves like ApplicationData.Current.LocalSettings. The "RoamingSettings" saves data locally, and never syncing between Mobile and PC or opposide, maybe because version difference, my Phone is running version 1507, while PC - 2010 (20H2) version. The Microsoft Account is the same in both devices. So how I can synchronize the clipboard between PC and Phone? Is there other APIs that allowing to sync data on UWP?
So, here is a simple function using "RoamingSettings".
static ApplicationDataContainer roamingSettings =
ApplicationData.Current.RoamingSettings;
public static void SendText(string text)
{
if (!roamingSettings.Values.ContainsKey("clipboardText"))
{
roamingSettings.Values.Add("clipboardText", text);
}
else
{
roamingSettings.Values["clipboardText"] = text;
}
}
public static string ReceiveText
{
get
{
if (roamingSettings.Values.ContainsKey("clipboardText"))
{
string text = roamingSettings.Values["clipboardText"].ToString();
return text;
}
return "";
}
}
Update
The ApplicationData.Current.RoamingStorageQuota returns 0 on PC, but on Mobile it returns 100 as normally.
Update 2
RoamingSettings has been discontinued since version 2004, see Windows 10 features we’re no longer developing. That's the reason why RoamingStorageQuota returns 0 instead of 100. So I've tested the app on Windows 10 1507 and it returns 100 and syncs the data, but after reinstalling the app on Mobile. However it's working on older versions.
The question is that is it possible to bring Package State Roaming (PSR) back to version 2004 or above? If no, are there alternatives for PSR?