Parse Apple SDK

repository·master·Indexed 25 days ago

https://github.com/parse-community/parse-sdk-ios-osx

A library providing access to the Parse Server backend for Apple platforms, including iOS, iPadOS, macOS, watchOS, and tvOS. Compatible with Parse Server version 1.0.0 and later, the SDK supports real-time updates via PFLiveQueryClient and is installable via Swift Package Manager.

Tokens
923
Snippets
1
Records
9
Agent score
34%

What's inside parse-sdk-ios-osx

  1. Install the Parse Apple SDK via Swift Package Manager

    master

    The easiest way to install the SDK is using Swift Package Manager (SPM). Follow these steps in Xcode:

    1. Open Xcode > File > Add packages...
    2. Enter the following package URL: https://github.com/parse-community/Parse-SDK-iOS-OSX
    3. Click Add Package.
    4. Select the specific submodules you wish to install for your project.
    https://github.com/parse-community/Parse-SDK-iOS-OSX
  2. Check Xcode and OS compatibility

    master

    The SDK follows the annual Xcode release schedule, supporting the current and previous major Xcode versions. Refer to the compatibility matrix below for specific SDK version requirements based on your environment:

    Xcode VersioniOS VersionmacOS VersionwatchOS VersiontvOS VersionParse Apple SDK Support
    Xcode 13iOS 15macOS 12watchOS 8tvOS 15>= 1.19.3 < 2.7.2
    Xcode 14iOS 16macOS 13watchOS 9tvOS 16>= 2.7.2 < 5.0.0
    Xcode 15iOS 17macOS 14watchOS 10tvOS 17>= 3.0.0 <= 5.1.1
    Xcode 16iOS 18macOS 15watchOS 11tvOS 18>= 4.2.0
    Xcode 26iOS 26macOS 26watchOS 26tvOS 26>= 6.2.0
  3. Initialize a PFLiveQueryClient

    master

    You can initialize a Client (exposed as PFLiveQueryClient in Objective-C) in two ways:

    1. Automatic Configuration: Use init() to create a client that automatically uses the server, application ID, and client key from Parse.currentConfiguration().
    2. Custom Configuration: Use initWithServer:applicationId:clientKey: to connect to a specific WebSocket server URL with custom credentials.

    Note that the server URL will be automatically converted to use the ws or wss scheme.

  4. Subscribe to live updates with PFQuery

    master

    To receive real-time updates for specific data changes, use the subscribe method on a Client instance. You can provide a PFQuery and a handler that conforms to SubscriptionHandling to process incoming updates.

    • subscribe(_:subclassType:): Registers a query using a default subscription handler.
    • subscribe(_:handler:): Registers a query with a custom handler for fine-grained control over update events.
  5. Manage client connection state

    master

    The Client allows manual control over the WebSocket connection:

    • reconnect(): Reconnects the client to the server. This will automatically disconnect the current socket and resubscribe all existing subscriptions. This is recommended when an error occurs.
    • disconnect(): Explicitly disconnects the client. This does not remove existing subscriptions; calling reconnect() later will restore them. Use this to dispose of the client.