PFPush(Synchronous)

@interface PFPush (Synchronous)

This category lists all methods of PFPush class that are synchronous, but have asynchronous counterpart, Calling one of these synchronous methods could potentially block the current thread for a large amount of time, since it might be fetching from network or saving/loading data from disk.

  • Synchronously send this push message.

    Declaration

    Objective-C

    - (BOOL)sendPush:(NSError *_Nullable *_Nullable)error;

    Parameters

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the send succeeded.

  • Synchronously send a push message to a channel.

    Declaration

    Objective-C

    + (BOOL)sendPushMessageToChannel:(nonnull NSString *)channel
                         withMessage:(nonnull NSString *)message
                               error:(NSError *_Nullable *_Nullable)error;

    Parameters

    channel

    The channel to send to. The channel name must start with a letter and contain only letters, numbers, dashes, and underscores.

    message

    The message to send.

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the send succeeded.

  • Send a push message to a query.

    Declaration

    Objective-C

    + (BOOL)sendPushMessageToQuery:(nonnull PFQuery<PFInstallation *> *)query
                       withMessage:(nonnull NSString *)message
                             error:(NSError *_Nullable *_Nullable)error;

    Parameters

    query

    The query to send to. The query must be a PFInstallation query created with PFInstallation.+query.

    message

    The message to send.

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the send succeeded.

  • Synchronously send a push message with arbitrary data to a channel.

    See the guide for information about the dictionary structure.

    Declaration

    Objective-C

    + (BOOL)sendPushDataToChannel:(nonnull NSString *)channel
                         withData:(nonnull NSDictionary *)data
                            error:(NSError *_Nullable *_Nullable)error;

    Parameters

    channel

    The channel to send to. The channel name must start with a letter and contain only letters, numbers, dashes, and underscores.

    data

    The data to send.

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the send succeeded.

  • Synchronously send a push message with arbitrary data to a query.

    See the guide for information about the dictionary structure.

    Declaration

    Objective-C

    + (BOOL)sendPushDataToQuery:(nonnull PFQuery<PFInstallation *> *)query
                       withData:(nonnull NSDictionary *)data
                          error:(NSError *_Nullable *_Nullable)error;

    Parameters

    query

    The query to send to. The query must be a PFInstallation query created with PFInstallation.+query.

    data

    The data to send.

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the send succeeded.

  • Synchronously get all the channels that this device is subscribed to.

    Declaration

    Objective-C

    + (nullable NSSet<NSString *> *)getSubscribedChannels:
            (NSError *_Nullable *_Nullable)error;

    Parameters

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns an NSSet containing all the channel names this device is subscribed to.

  • Synchrnously subscribes the device to a channel of push notifications.

    Declaration

    Objective-C

    + (BOOL)subscribeToChannel:(nonnull NSString *)channel
                         error:(NSError *_Nullable *_Nullable)error;

    Parameters

    channel

    The channel to subscribe to. The channel name must start with a letter and contain only letters, numbers, dashes, and underscores.

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the subscribe succeeded.

  • Synchronously unsubscribes the device to a channel of push notifications.

    Declaration

    Objective-C

    + (BOOL)unsubscribeFromChannel:(nonnull NSString *)channel
                             error:(NSError *_Nullable *_Nullable)error;

    Parameters

    channel

    The channel to unsubscribe from.

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the unsubscribe succeeded.