amazon-sns

aws sns confirm subscription request processing issue

半城伤御伤魂 提交于 2019-12-11 00:26:22
问题 I am trying to implement the aws sns service for a bucket in s3 and i am following this document https://docs.aws.amazon.com/sns/latest/dg/SendMessageToHttp.html according to this there will be subscribe url in the request for the confirmation subscription which will be coming to the url that we provide, but i am receiving empty body in the request. I tried to log the body but gave me an empty object. and tried by using the bodyparser but same result. here is my route that i am implementing.

Unable to deliver worldwide text message from aws lambda function

亡梦爱人 提交于 2019-12-11 00:09:09
问题 I am trying to send OTP from my AWS Lambda function hosted in AP-South-1 (i.e. Mumbai) region. I am using a worldwide text-messaging feature of SNS for this. As the "AP-South-1" region does not support worldwide text-messaging feature, I am sending the SNSClient's region endpoint as "APNortheast1" (i.e. Tokyo) region as it supports worldwide text-messaging. Now, I have given my lambda function administrator privilege (by attaching role with administrator policy). But, still, it doesn't seem

AWS lambda to send SNS “succeeds” but not message actually sent

拥有回忆 提交于 2019-12-11 00:04:15
问题 I've written an AWS lambda function to send a text message when an S3 object is uploaded. I've confirmed the subscription and I can receive test messages sent from the SNS console. When I test the lambda all the logs say the method succeeds but no sons message ever arrives. Here is the function (mostly just the sample template but changed my topic arn in this post for security). Any hints of things to test/try next are appreciated. console.log('Loading function'); var aws = require('aws-sdk')

Badge count option in amazon SNS

烂漫一生 提交于 2019-12-10 16:26:38
问题 I need to get badge count in my application. I am using amazon SNS service. Here is my code AWS.config.update({ accessKeyId: 'XXXXXXX', secretAccessKey: 'XXXXXXX' }) AWS.config.update({ region: 'XXXXXXX' }) const sns = new AWS.SNS() const params = { PlatformApplicationArn: 'XXXXXXX', Token: deviceToken } sns.createPlatformEndpoint(params, (err, EndPointResult) => { const client_arn = EndPointResult["EndpointArn"]; sns.publish({ TargetArn: client_arn, Message: message, Subject: title, // badge

Jackson deserialization SNS message error MismatchedInputException

半城伤御伤魂 提交于 2019-12-10 16:17:39
问题 I'm coding a functionality of handling callbacks from Amazon Simple Email Service via SNS HTTP requests. I would like to parse message provided by Amazon to local object structure. Problem is that SNS is wrapping JSON message into String and it could not be parsed by Jackson. I'm getting an error: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `xxx.email.domain.aws.ses.Notification` (although at least one Creator exists): no String-argument

double push notification created with React Native + Expo + FCM

怎甘沉沦 提交于 2019-12-10 15:34:40
问题 I'm trying to create an app that can receive push notification. The push notifications are sent using AWS SNS and using FCM token rather than Expo's Token . The notifications were received, however, every notification was received twice by the system tray. I tried using a phone without expo installed, but it still received 2 notifications. this is my payload request when sending to SNS { "GCM": "{ \"notification\": { \"text\": \"test message\" } }" } Any idea why this is happening? I'm

Amazon SNS For Apple - Error loading apple credentials from file

混江龙づ霸主 提交于 2019-12-10 12:33:14
问题 I'm trying to create SNS Application for IOS. After uploading the .p12 file and entering the password I clicked on "Load Credentials From File" button, but I always get the following error message: "Error loading apple credentials from file" Please, does anybody know what's going on? what's the problem? 回答1: You have exported the wrong P12 file. Open KeyChain Access, click "Certificates" at the left panel, click the arrow at the left hand side of your certificate, there's a private key below.

AWS - Create an AmazonSNSClient

≡放荡痞女 提交于 2019-12-10 11:54:48
问题 I want to create a AmazonSNSClient, I use this piece of code: AmazonSNSClient snsClient = (AmazonSNSClient) AmazonSNSClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(new PropertiesCredentials(is))).build(); but I get this error: Exception in thread "main" java.lang.UnsupportedOperationException: Client is immutable when created with the builder. at com.amazonaws.AmazonWebServiceClient.checkMutability(AmazonWebServiceClient.java:937) at com.amazonaws

AWS CloudWatch log subscription filters decode

ぃ、小莉子 提交于 2019-12-10 08:40:49
问题 I am using CloudWatch log subscription filters stream to Lambda and publish a message to an SNS topic. But it will output garbled message and can't success decode. my output: k %" jVbB If not decode will output like this: { "awslogs": {"data": "BASE64ENCODED_GZIP_COMPRESSED_DATA"} } My code is below and it is using nodejs: console.log("Loading function"); var AWS = require("aws-sdk"); exports.handler = function(event, context) { var eventText = JSON.stringify(event, null, 2); var decodeText =

How do I check whether a mobile device has already been registered

非 Y 不嫁゛ 提交于 2019-12-09 16:11:41
问题 I'm using the Amazon AWS Ruby SDK for Amazon SNS but I'm having some trouble with devices already being registered. Sometimes when a device gets registered again I get an error like AWS::SNS::Errors::InvalidParameter Invalid parameter: Token Reason: Endpoint arn:aws:sns:us-east-1:**** already exists with the same Token, but different attributes. . How do I check whether an endpoint already exists and more importantly, how do I get the endpoint for a given token? 回答1: Credit to BvdBijl's idea,