GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - parse-community/ParseLiveQuery-iOS-OSX: Parse LiveQuery Client for iOS/OS X.

This repository was archived by the owner on Jun 13, 2023. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

124 Commits
124 Commits

Folders and files

NameName
Last commit message
Last commit date
.circleci
.circleci
 
 
.github
.github
 
 
Carthage/Checkouts
Carthage/Checkouts
 
 
Examples
Examples
 
 
ParseLiveQuery.xcworkspace
ParseLiveQuery.xcworkspace
 
 
Sources
Sources
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
.ruby-version
.ruby-version
 
 
.swiftlint.yml
.swiftlint.yml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Cartfile
Cartfile
 
 
Cartfile.resolved
Cartfile.resolved
 
 
Gemfile
Gemfile
 
 
Gemfile.lock
Gemfile.lock
 
 
LICENSE
LICENSE
 
 
PATENTS
PATENTS
 
 
ParseLiveQuery.podspec
ParseLiveQuery.podspec
 
 
README.md
README.md
 
 
jazzy.sh
jazzy.sh
 
 

Repository files navigation

Parse LiveQuery Client for iOS/OSX


⚠️ The LiveQuery feature has been added as a module to the Parse Apple SDK. This repository is archived and will no longer receive any updates.


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.

About

Parse LiveQuery Client for iOS/OS X.

parseplatform.org

Topics

parse-iosparse-livequeryparse-platform

Resources

Readme
License

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

193 stars

Watchers

5 watching

Forks

127 forks
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.