/AWS1/IF_SNS=>CREATEPLATFORMENDPOINT()¶
About CreatePlatformEndpoint¶
Creates an endpoint for a device and mobile app on one of the supported push
notification services, such as GCM (Firebase Cloud Messaging) and APNS.
CreatePlatformEndpoint requires the PlatformApplicationArn
that is returned from CreatePlatformApplication. You can use the returned
EndpointArn to send a message to a mobile app or by the
Subscribe action for subscription to a topic. The
CreatePlatformEndpoint action is idempotent, so if the requester
already owns an endpoint with the same device token and attributes, that endpoint's ARN
is returned without creating a new endpoint. For more information, see Using Amazon SNS Mobile Push
Notifications.
When using CreatePlatformEndpoint with Baidu, two attributes must be
provided: ChannelId and UserId. The token field must also contain the ChannelId. For
more information, see Creating an Amazon SNS Endpoint for
Baidu.
Method Signature¶
METHODS /AWS1/IF_SNS~CREATEPLATFORMENDPOINT
IMPORTING
!IV_PLATFORMAPPLICATIONARN TYPE /AWS1/SNSSTRING OPTIONAL
!IV_TOKEN TYPE /AWS1/SNSSTRING OPTIONAL
!IV_CUSTOMUSERDATA TYPE /AWS1/SNSSTRING OPTIONAL
!IT_ATTRIBUTES TYPE /AWS1/CL_SNSMAPSTRTOSTR_W=>TT_MAPSTRINGTOSTRING OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_snscreateendptrsp
RAISING
/AWS1/CX_SNSAUTHERROREXCEPTION
/AWS1/CX_SNSINTERNALERROREX
/AWS1/CX_SNSINVALIDPARAMETEREX
/AWS1/CX_SNSNOTFOUNDEXCEPTION
/AWS1/CX_SNSCLIENTEXC
/AWS1/CX_SNSSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_platformapplicationarn TYPE /AWS1/SNSSTRING /AWS1/SNSSTRING¶
PlatformApplicationArnreturned from CreatePlatformApplication is used to create a an endpoint.
iv_token TYPE /AWS1/SNSSTRING /AWS1/SNSSTRING¶
Unique identifier created by the notification service for an app on a device. The specific name for Token will vary, depending on which notification service is being used. For example, when using APNS as the notification service, you need the device token. Alternatively, when using GCM (Firebase Cloud Messaging) or ADM, the device token equivalent is called the registration ID.
Optional arguments:¶
iv_customuserdata TYPE /AWS1/SNSSTRING /AWS1/SNSSTRING¶
Arbitrary user data to associate with the endpoint. Amazon SNS does not use this data. The data must be in UTF-8 format and less than 2KB.
it_attributes TYPE /AWS1/CL_SNSMAPSTRTOSTR_W=>TT_MAPSTRINGTOSTRING TT_MAPSTRINGTOSTRING¶
For a list of attributes, see
SetEndpointAttributes.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_snscreateendptrsp /AWS1/CL_SNSCREATEENDPTRSP¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->createplatformendpoint(
it_attributes = VALUE /aws1/cl_snsmapstrtostr_w=>tt_mapstringtostring(
(
VALUE /aws1/cl_snsmapstrtostr_w=>ts_mapstringtostring_maprow(
key = |string|
value = new /aws1/cl_snsmapstrtostr_w( |string| )
)
)
)
iv_customuserdata = |string|
iv_platformapplicationarn = |string|
iv_token = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_string = lo_result->get_endpointarn( ).
ENDIF.