Subscribing to a push initiator

You can use the Communication API to send a subscription request to a content provider's URI. In addtition to the SenderDestination object that sends the subscription request, you need to create a ReceiverDestination object that defines the MessageListener object to which the BlackBerry® device should deliver incoming push messages from a given URI.

The following table describes the components that are involved in a subscription request.

Component

Description

SenderDestination

This component sends the subscription message to the content provider. This component is optional. You can send a subscription message using any type of network connection. For example, you can use the Network API to create an HTTPConnection and send the subscription parameters manually.

Subscription message

The Communication API can create a properly formed subscription message for you. You can invoke BpsSubscriptionMessageBuilder.createByteSubscriptionMessage() to retrieve a ByteMessage object that is configured for your SenderDestination, NonBlockingReceiverDestination, and the MessageListener where you want to receive incoming push messages.

NonBlockingReceiverDestination

This component associates a particular URI with a MessageListener where you want to receive incoming push messages, and an InboundDestinationConfiguration object.

InboundDestinationConfiguration

This component specifies a variety of push service parameters, such as an indicator that specifies whether your application should be started when a new push message arrives. You can create an InboundDestinationConfiguration using the InboundDestinationConfigurationFactory class.

MessageListener

This component processes incoming push messages.


Was this information helpful? Send us your comments.