This is my attempt to make this repo available on swift package manager

Overview

Parse LiveQuery Client for iOS/OSX

Platforms Carthage compatible Podspec License ci release Build Status Join The Conversation Backers on Open Collective Sponsors on Open Collective Twitter Follow

PFQuery is one of the key concepts for Parse. It allows you to retrieve PFObjects by specifying some conditions, making it easy to build apps such as a dashboard, a todo list or even some strategy games. However, PFQuery is based on a pull model, which is not suitable for apps that need real-time support.

Suppose you are building an app that allows multiple users to edit the same file at the same time. PFQuery would not be an ideal tool since you can not know when to query from the server to get the updates.

To solve this problem, we introduce Parse LiveQuery. This tool allows you to subscribe to a PFQuery you are interested in. Once subscribed, the server will notify clients whenever a PFObject that matches the PFQuery is created or updated, in real-time.

Setup Server

Parse LiveQuery contains two parts, the LiveQuery server and the LiveQuery clients. In order to use live queries, you need to set up both of them.

The easiest way to setup the LiveQuery server is to make it run with the Open Source Parse Server.

Install Client

Cocoapods

You can install the LiveQuery client via including it in your Podfile:

pod 'ParseLiveQuery'

Use Client

The LiveQuery client interface is based around the concept of Subscriptions. You can register any PFQuery for live updates from the associated live query server, by simply calling subscribe() on a query:

let myQuery = Message.query()!.where(....)
let subscription: Subscription<Message> = Client.shared.subscribe(myQuery)

Where Message is a registered subclass of PFObject.

Once you've subscribed to a query, you can handle events on them, like so:

subscription.handleEvent { query, event in
    // Handle event
}

You can also handle a single type of event, if that's all you're interested in:

// Note it's handle(), not handleEvent()
subscription.handle(Event.created) { query, object in
    // Called whenever an object was created
}

By default, it will print the logs from WebSocket / WebSocketDelegate. You can turn it off:

Client.shared.shouldPrintWebSocketLog = false

You can also enable socket trace messages for all sent and received strings. By default, these trace messages are disabled.

Client.shared.shouldPrintWebSocketTrace = true

Handling errors is and other events is similar, take a look at the Subscription class for more information.

Advanced Usage

You are not limited to a single Live Query Client - you can create your own instances of Client to manually control things like reconnecting, server URLs, and more.

How Do I Contribute?

We want to make contributing to this project as easy and transparent as possible. Please refer to the Contribution Guidelines.


As of April 5, 2017, Parse, LLC has transferred this code to the parse-community organization, and will no longer be contributing to or distributing this code.

You might also like...
Switch viewcontroller like ios task manager
Switch viewcontroller like ios task manager

Kaeru Kaeru can switch ViewController in NavigationController like iOS task manager UI (after iOS 9). Movie Usage You can use HistoryNavigationControl

Quickstart-ios-swift-grpc - Quickstart for integrating Approov with iOS apps in Swift that make API requests you wish to protect using GRPC
Make it easier to observe network connectivity in SwiftUI.

ReachabilityX ReachabilityX is built using NWPathMonitor from Apple's Network framework to provide an easy way to observe the network changes for Swif

A Swift Package that allows iOS apps to communicate with AltServer.

AltKit allows apps to communicate with AltServers on the same WiFi network and enable features such as JIT compilation.

Swift package for adding API Key requirement to vapor backends.

APIKeyMiddleware Swift package for adding API Key requirement to vapor backends. Features ✅ Supports an array of keys ✅ Supports overriding thrown err

Create xcframework zip archive for Swift binary package.

xczip xczip - create xcframework zip archive for swift binary package. Creates an xcframework archive with a stable checksum that does not change when

NotionDrive - A swift package that can upload files to Notion.so or download files from Notion.so

NotionDrive NotionDrive is a swift package that can upload files to Notion.so or

UDPReader : a simple package for reading udp packets

UDPReader is a simple package for reading udp packets

AsyncWebSocketClient - A package that contains a client behaving as a wrapper for the URLSessionWebSocketTask

(WORK IN PROGRESS) AsyncWebSocketClient This is a package that contains a client

Owner
Benji
Benji
Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux.

BlueSocket Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux. Prerequisites Swift Swift Open Source swift-5.1

Kitura 1.3k Dec 26, 2022
Lightweight REST library for iOS and watchOS. Available on cococapods

RMHttp RMHttp is a Lightweight REST library for iOS and watchOS. Features Chainable Request URL / JSON Parameter Encoding HTTP Methods GET/POST/DELETE

Roger Molas 7 Nov 19, 2022
Commonly available global error type packages

ErrorKit 일반적으로 사용 할 수 있는 전역 오류 타입 패키지. Requirements Xcode 13.2.1+ Swift 5.5+ Ins

Jaemyeong Jin 0 Nov 6, 2022
SwiftyReachability is a simple and lightweight network interface manager written in Swift.

SwiftyReachability is a simple and lightweight network interface manager written in Swift. Freely inspired by https://github.com/tonymillion/Reachabil

Antonio Guerra 5 Nov 4, 2022
🌸 Powerful Codable API requests builder and manager for iOS.

This lib is about network requests with blackjack, roulette and craps! Using it you will be able to convert your massive API layer code into an awesom

CodyFire 251 Jan 8, 2023
A progressive download manager for Alamofire

ALDownloadManager A progressive download manager for Alamofire (Alamofire下载器) The default support breakpoint continues. Sequential Download(顺序下载 ) Dow

null 48 May 1, 2022
A modern download manager based on NSURLSession to deal with asynchronous downloading, management and persistence of multiple files.

TWRDownloadManager TWRDownloadManager A modern download manager for iOS (Objective C) based on NSURLSession to deal with asynchronous downloading, man

Michelangelo Chasseur 407 Nov 19, 2022
Say goodbye to the Fat ugly singleton Network Manager with this Network Layer

MHNetwork Protocol Oriented Network Layer Aim to avoid having bloated singleton NetworkManager Philosophy the main philosophy behind MHNetwork is to h

Mohamed Emad Hegab 19 Nov 19, 2022
iOS Project Manager Client

08-iOS-Project-Manager-Client 프로젝트 매니저 STEP 1 프로젝트 할일 리스트 기능구현 UI구현방식 : 코드 아키텍쳐 : ProjectManagerViewController : NavigationViewController위에 StackView(

Kioding87 1 Nov 19, 2021
Rayon - Yet another SSH machine manager for macOS

Rayon A server monitor tool for linux based machines using remote proc file syst

Lakr Aream 2.3k Jan 8, 2023