AmazonSimpleNotificationServiceClient - How to PublishRequest with TargetArn that contains Custom Payload without "default" value?

Viewed 34

I have:

  1. Written a running Android App that recieved FCM notification.
  2. Setup Amazon SNS: Mobile:Push notifications.
  3. I am able to publish message using Amazon SNS Console through "Custom payload for each delivery protocol".

{ "GCM": "{ "data": { "MyTitle": "Sample endpoints", "MyMessage": "Important" } }" }

Amazon SNS Console - Publish Message

  1. My running Android App is able to recieve the message with "data" only. This is what I expected to recieve.

"{MyTitle=Sample endpoints, MyMessage=Important}"

Android Studio - Message received

  1. Wrote a .NET application using "AmazonSimpleNotificationServiceClient" [AWSSDK.SimpleNotificationService 3.7.4.3] to publish request, trying to do the exact same way to publish message like Amazon SNS Console. I am able to published successfully.

Visual studio .NET Application

  1. My running Android App recieved the message but the message is wrapped within the "default" attribute. This is not expected, I want the same message I recieved from the Amazon SNS Console.

{default={"GCM": "{ "data": {"MyTitle": "Sample endpoints", "MyMessgae" : "Criticald" } } " }}

Android Studio - Message received

  1. I tried to utilize PublishRequest.MessageSturcture to "json" (this requires "default" attribute before it can be published). I removed that, the message automatically wrapped with "default".
  2. How do I send custom raw message from .NET Application the same way I can send "Custom Payload for each delivery protocol" from Amazon SNS Console? I want to publish to the "platform endpoint ARN".
0 Answers
Related