aws-amplify / aws-sdk-ios

AWS SDK for iOS. For more information, see our web site:
https://aws-amplify.github.io/docs
Other
1.68k stars 879 forks source link

Push notifications not working while sending the message from backend to a specific user #1502

Closed rohit3d2003 closed 5 years ago

rohit3d2003 commented 5 years ago

State your question I am trying to send message to pinpoint users from Lambda but it fails with a response 'No endpoints found for userId'. I have followed the manual setup where-in, I am updating userId after registration through iOS code and I can see that the endpoint is properly updated with UserId set to the one that I provided with 'OptOut' set to 'NONE'. Also, I have tested messaging from Pinpoint and it works. The only issue I have is to publish a message from Lambda to Pinpoint. I am not sure if I am doing anything wrong here.

Which AWS Services are you utilizing? Pinpoint, Lambda Provide code snippets (if applicable) Swift:

Screen Shot 2019-04-27 at 10 50 35 AM

Lambda:

Screen Shot 2019-04-27 at 10 51 40 AM

Lambda Result: {"SendUsersMessageResponse":{"ApplicationId”:”xxxxxxxxx”,”RequestId":"fbdb4315-690e-11e9-8d19-0f8d87c990b4","Result”:{“\”xxxxxxx\””:{“”:{“Address":"","DeliveryStatus":"PERMANENT_FAILURE","StatusCode":400,"StatusMessage":"No endpoints found for userId."}}}}}

Environment(please complete the following information):

Device Information (please complete the following information):

If you need help with understanding how to implement something in particular then we suggest that you first look into our developer guide. You can also simplify your process of creating an application, as well as the associated backend setup by using the Amplify CLI.

rohit3d2003 commented 5 years ago

Fixed it myself. Forgot to parse the string in lambda and hence wasn't publishing it to the correct user