YB.ParseLiveQueryDotNet 3.0.0

dotnet add package YB.ParseLiveQueryDotNet --version 3.0.0                
NuGet\Install-Package YB.ParseLiveQueryDotNet -Version 3.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="YB.ParseLiveQueryDotNet" Version="3.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add YB.ParseLiveQueryDotNet --version 3.0.0                
#r "nuget: YB.ParseLiveQueryDotNet, 3.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install YB.ParseLiveQueryDotNet as a Cake Addin
#addin nuget:?package=YB.ParseLiveQueryDotNet&version=3.0.0

// Install YB.ParseLiveQueryDotNet as a Cake Tool
#tool nuget:?package=YB.ParseLiveQueryDotNet&version=3.0.0                

v3.0.0 🎄

Major Update! - VERY IMPORTANT FOR SECURITY

Please update to this version as soon as possible to avoid any security issues.

  • Fixed an issue where connected Live Queries would never actually close stream with server (causing memory leaks).

  • This eliminates any instance where a "Disconnected" user would still be able to receive data from the server and vice versa.

  • The best I would suggest is to migrate the Currently Observed Classes to a new class and delete the old one.

You can easily do this by creating a new class and copying the data from the old class to the new one (via ParseCloud in your web interface like in Back4App).

Full Wiki

More Fixes...

  • Fixed issues where GetCurrentUIser() from Parse did NOT return userName too.
  • Fixed issues with Relations/Pointers being broken.

Thank You for Upgrading and Your Patience ❤️

For any issues, please freely open an issue on GitHub

v2.0.4

Improvements on base Parse SDK.

  • LogOut now works perfectly fine and doesn't crash app!
  • SignUpWithAsync() will now return the Signed up user's info to avoid Over querying.
  • Renamed some methods.
  • Fixed perhaps ALL previous UNITY crashes.

(Will do previous versions later - I might never even do it )

Parse-Live-Query-Unofficial v2 (with RX and LINQ Support) - soon

Key Changes from v1:

  • Now supports .NET 5, 6, 7, 8, and .NET MAUI.
  • Uses System.Net.WebSockets.Client for better connectivity.
  • Replaced callbacks (CB) with Reactive Extensions (Rx.NET) for event handling.
  • Full LINQ support integrated.
  • Enhanced stability and MAUI compatibility.

Thanks 😃 to:

What is Live Query?

Live Query provides real-time data sync between server and clients over WebSockets. When data changes on the server, subscribed clients are instantly notified.

Prerequisites

  • Ensure Live Query is enabled for your classes in the Parse Dashboard.

Example in Back4App:

Enable Live Queries in Back4Apps

Basic Setup

1. Initialization

using Parse; // Parse
using Parse.LiveQuery; // ParseLQ
using System.Reactive.Linq; // For Rx
using System.Linq; // For LINQ
using System.Collections.ObjectModel;

// Check internet
if (Connectivity.NetworkAccess != NetworkAccess.Internet)
{
    Console.WriteLine("No Internet, can't init ParseClient.");
    return;
}

// Init ParseClient
var client = new ParseClient(new ServerConnectionData
{
    ApplicationID = "YOUR_APP_ID",
    ServerURI = new Uri("YOUR_SERVER_URL"),
    Key = "YOUR_CLIENT_KEY" // or MasterKey
}, new HostManifestData
{
    Version = "1.0.0",
    Identifier = "com.yourcompany.yourmauiapp",
    Name = "MyMauiApp"
});

client.Publicize(); // Access via ParseClient.Instance globally

2. Simple Subscription Setup

// Create LiveQuery client
ParseLiveQueryClient LiveClient = new ParseLiveQueryClient();

void SetupLiveQuery()
{
    try
    {
        var query = ParseClient.Instance.GetQuery("TestChat");
        var subscription = LiveClient.Subscribe(query);
        
        LiveClient.ConnectIfNeeded();

        // Rx event streams
        LiveClient.OnConnected
            .Subscribe(_ => Debug.WriteLine("LiveQuery connected."));
        LiveClient.OnDisconnected
            .Subscribe(info => Debug.WriteLine(info.userInitiated 
                ? "User disconnected." 
                : "Server disconnected."));
        LiveClient.OnError
            .Subscribe(ex => Debug.WriteLine("LQ Error: " + ex.Message));
        LiveClient.OnSubscribed
            .Subscribe(e => Debug.WriteLine("Subscribed to: " + e.requestId));

        // Handle object events (Create/Update/Delete)
        LiveClient.OnObjectEvent
            .Where(e => e.subscription == subscription)
            .Subscribe(e =>
            {
                Debug.WriteLine($"Event {e.evt} on object {e.objState.ObjectId}");
            });

    }
    catch (Exception ex)
    {
        Debug.WriteLine("SetupLiveQuery Error: " + ex.Message);
    }
}

Conclusion

This v3 version integrates LINQ and Rx.NET, enabling highly flexible and reactive real-time data flows with Parse Live Queries. Advanced filtering, buffering, throttling, and complex transformations are now possible with minimal code. Full Wiki PRs are welcome!

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.0 73 12/21/2024
2.0.4 85 12/17/2024
2.0.3 75 12/13/2024
2.0.1 76 12/13/2024
1.0.0 86 12/5/2024

See detailed release notes in ReleaseNotes.md