The Amazon SDK for Java 1.x has entered maintenance mode as of July 31, 2024,
and will reach end-of-support
Updating Channels in Amazon Pinpoint
A channel defines the types of platforms to which you can deliver messages. This example shows how to use the APNs channel to send a message.
Update a Channel
Enable a channel in Amazon Pinpoint by providing an app ID and a request object of the channel type you want to update. This example updates the APNs channel, which requires the APNSChannelRequest object. Set these in the UpdateApnsChannelRequest and pass that object to the AmazonPinpointClient’s updateApnsChannel
method.
Imports
import com.amazonaws.services.pinpoint.AmazonPinpoint; import com.amazonaws.services.pinpoint.AmazonPinpointClientBuilder; import com.amazonaws.services.pinpoint.model.APNSChannelRequest; import com.amazonaws.services.pinpoint.model.APNSChannelResponse; import com.amazonaws.services.pinpoint.model.GetApnsChannelRequest; import com.amazonaws.services.pinpoint.model.GetApnsChannelResult; import com.amazonaws.services.pinpoint.model.UpdateApnsChannelRequest; import com.amazonaws.services.pinpoint.model.UpdateApnsChannelResult;
Code
APNSChannelRequest request = new APNSChannelRequest() .withEnabled(enabled); UpdateApnsChannelRequest updateRequest = new UpdateApnsChannelRequest() .withAPNSChannelRequest(request) .withApplicationId(appId); UpdateApnsChannelResult result = client.updateApnsChannel(updateRequest);
See the complete example
More Information
-
Amazon Pinpoint Channels in the Amazon Pinpoint User Guide
-
ADM Channel
in the Amazon Pinpoint API Reference -
APNs Channel
in the Amazon Pinpoint API Reference -
APNs Sandbox Channel
in the Amazon Pinpoint API Reference -
APNs VoIP Channel
in the Amazon Pinpoint API Reference -
APNs VoIP Sandbox Channel
in the Amazon Pinpoint API Reference -
Baidu Channel
in the Amazon Pinpoint API Reference -
Email Channel
in the Amazon Pinpoint API Reference -
GCM Channel
in the Amazon Pinpoint API Reference -
SMS Channel
in the Amazon Pinpoint API Reference