LCPush
public class LCPush
LeanCloud Push Client
-
Send push notification synchronously.
Declaration
Swift
public static func send( application: LCApplication = .default, data: [String: Any], query: LCQuery? = nil, channels: [String]? = nil, pushDate: Date? = nil, expirationDate: Date? = nil, expirationInterval: TimeInterval? = nil, extraParameters: [String: Any]? = nil) -> LCBooleanResult
Parameters
application
The application, default is
LCApplication.default
.data
The body data of the push message.
query
The query condition, if this parameter be set, then
channels
will be ignored.channels
The channels condition, if
query
be set, then this parameter will be ignored.pushDate
The date when to send.
expirationDate
The expiration date of this push notification.
expirationInterval
The expiration interval from
pushDate
of this push notification.extraParameters
The extra parameters, for some specific configuration.
Return Value
Boolean result, see
LCBooleanResult
. -
send(application:
data: query: channels: pushDate: expirationDate: expirationInterval: extraParameters: completionQueue: completion: ) Send push notification asynchronously.
Declaration
Swift
@discardableResult public static func send( application: LCApplication = .default, data: [String: Any], query: LCQuery? = nil, channels: [String]? = nil, pushDate: Date? = nil, expirationDate: Date? = nil, expirationInterval: TimeInterval? = nil, extraParameters: [String: Any]? = nil, completionQueue: DispatchQueue = .main, completion: @escaping (LCBooleanResult) -> Void) -> LCRequest
Parameters
application
The application, default is
LCApplication.default
.data
The body data of the push message.
query
The query condition, if this parameter be set, then
channels
will be ignored.channels
The channels condition, if
query
be set, then this parameter will be ignored.pushDate
The date when to send.
expirationDate
The expiration date of this push notification.
expirationInterval
The expiration interval from
pushDate
of this push notification.extraParameters
The extra parameters, for some specific configuration.
completionQueue
The queue where
completion
be called.completion
The result callback.
Return Value
The request, see
LCRequest
.