ParseLiveQuery doesn't catch any event for IOS

105 Views Asked by At

I implemented the documentation exactly, but the events are not handle.

My code is :

let serverUrl = "xxxxxxxxxxxx"
    let appId = "xxxxxxxxxxxx"
    let clientKey = "xxxxxxxxxxxxxxx"
    let client = ParseLiveQuery.Client(server: serverUrl, applicationId: appId, clientKey: clientKey)
    let query = PFQuery(className: "ChatMessage")
    query.whereKey("to", equalTo: PFUser.current() ?? PFUser())

    let subscription: Subscription = client.subscribe(query)

    client.shouldPrintWebSocketLog = true
    client.shouldPrintWebSocketTrace = true

    subscription.handleEvent { query, event in
        print(event)
    }

    subscription.handle(Event.created) { query, object in
        print(object)
    }

After , i send new message with api. This message added class , but livequery not handle any event and data.

0

There are 0 best solutions below