I am trying to get EndpointArn by registration id using aws .net sdk. But i couldn't find a nice way to do it.
My first attempt was running CreatePlatformEndpointRequest with the same registrationId, which is registered to SNS Application before, sent by the client(android). With this way, aws api gives you the EndpointArn for this registration id.
Amazon: 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.
But if you stored something to CustomUserData before you need to send the same user data to get endpoint arn for this registration id, otherwise you get an exception like below.
Invalid parameter: Token Reason: Endpoint {My Endpoint ARN} already exists with the same Token, but different attributes.
I think i am going to use CreatePlatformEndpoint() without user data and when i need Endpoint Arn for a registrationId i will run CreatePlatFormEndpoint only with this registration id.
Is there another way to get EndpointArn by token better than the solution above ?
Thank you.