AWS Pinpoint - Unregistered Application. Pinpoint is not registered in PNS - amazon-web-services

We have registered FCM server key on Pinpoint. We were able to successfully receive messages on our emulator when tested with Cloud Messaging on Firebase console. However, when we are trying to send push notification using GCM channel of 'sendUsersMessages' API - we receive below error for endpoint
"DeliveryStatus": "PERMANENT_FAILURE",
"StatusCode": 404,
"StatusMessage": "{\"errorMessage\":\"Unregistered Application\",\"channelType\":\"GCM\",\"pushProviderStatusCode\":\"0\",\"pushProviderError\":\"a153cc45babasomepinpointid67073b-gcm#Pinpoint is not registered in PNS.\"}"
What does this error mean? Does it mean our Pinpoint application is not registered on Firebase? Or our device doesn't have token? or something else. Couldn't find any answers. Please help

After some play around - figured out that I was using RestrictedPackageName matching my application's FCM console package name (like com.xyz.app.abc) - I removed that and push notification went through successfully.

Related

Triggering a Cloud Function off GCP Error Reporting Webhook

I'm working on connecting Cloud Error Reporting to an on request Cloud Function (to eventually liaise with the JIRA API).
I have been able to successfully receive Monitoring Notification Channels' test notification to the webhook, however events triggering the email notification channel do not also trigger the webhook.
Is there a way to dispatch on error reporting event to a web URL or pubsub job with error_group attached?
Upon checking on a documentation regarding managing notification channels. Webhooks isn't supported by error reporting, as of now you can select 2 types of notification channels: email and mobile.
There's an ongoing feature request for Webhooks to be added in error reporting notification channel, but there's no ETA when this feature be rolled out . Please star and comment if you wanted the feature to be implemented in the future.

AWS Pinpoint error after updating APNS certificate with Expo

After sending a new build to the app store, the push notifications for my app are no longer working. During the build, expo made a new APNS certificate, and now when I try to push a notification to users, I get the following error message.
"'{"errorMessage":"Invalid
Credentials","channelType":"APNS","pushProviderStatusCode":"403","pushProviderError":"InvalidProviderToken","pushProviderResponse":"{\"reason\":\"InvalidProviderToken\"}"}'"
I get the same error message when attempting to send myself a notification through the AWS Console. I tried to update my push notification credentials on expo, but get a similar error:
? Path to P8 file: /Users/REDACTED/Downloads/AuthKey_D3QREDACTED-1.p8
? Key ID: REDACTED ? Apple Team ID: REDACTED Unable to validate Push
Keys due to insufficient Apple Credentials
I tried following every thread I could find online about the error and verified that I had the right Team ID and Key ID, but it still does not work.
Happy to provide more info if needed, and thank you for your help
I just had to regenerate a new .p8 file and upload it to AWS pinpoint
I had this issue recently, and no matter how many times I tired to "Edit" the APNs configuration it would not work. Eventually I just removed APNs setting from PinPoint, saved it, and then set it up again fresh.
Now it works.

AWS Lex and Facebook Messenger Integration Not Working

I'm banging my head against the wall trying to get an AWS Lex based chatbot integrated with Facebook.
As far as I can tell, everything is set up correctly.
When I send a message to my page in Facebook, I don't get a reply. However, the analytics in my app shows that the app is getting messages, so I know the message is making it from the page to the app.
When I try to hit the AWS Lex Webhook directly using POSTMAN, the webhook responds to literally everything I sent to it with a blank HTTP 200 OK response.
The lambda function that is tied to the AWS Lex chatbot is not getting invoked as a result of the messages from Facebook because no logs are getting generated and cloudwatch doesn't show an attempts to run the lambda function.
Does anyone have any ideas?
UPDATE : I ended up engineering around this by bypassing the Facebook channel capability inside AWS Lex and using Lambda instead. I deployed a passthrough API which calls a lambda function and then interacts with AWS Lex via Boto3/Python. In theory this is all supposed to be taken care of from inside AWS Lex with the Facebook channel integration, but I wasn't able to get it to work so I just built around it.
Verify Amazon lex is properly configured with facebook messenger .
Check : Page access token
Verification token
App ID
Check if your webhook is subscribed to page you are messaging on.
Check if your facebook user is added as tester/admin/developer
Check if your latest version of BOt is published on intended alias.
Also while configuring webhook tick necessary options : messages, messaging_postbacks, messaging_optins, message_deliveries, message_reads, messaging_payments
This should resolve your head ache. If not please reply

Pinpoint is not delivering push notification on Android

I am using aws mobileHub for my react-native project. I am using aws-amplify library to use aws features in my app and i follow all the steps of aws-Pinpoint and aws-amplify for push notifications in android . When app open I get the token from 'aws-amplify-react-native' but when I start campaign it sometimes deliver few messages sometimes none but I received none of it and when I try direct messages then it says successfully send push notification from pinpoint console but I received nothing in app. Here is the image of success message
Would you mind testing sending a test message using the AWS CLI. The reason is that the CLI would be able to give you a more detailed error message. It would look something like this.
aws pinpoint send-messages --application-id {appid} --message-request '{
"Addresses": {
"{token}": {
"ChannelType": "GCM"
}
},
"MessageConfiguration": {
"GCMMessage": {
"Body": "Test Body",
"Title": "Test Title"
}
}
}
Hopefully the response you get from this will tell you the reason why your requests are failing. My guess of what is wrong is that you somehow have an invalid token.

Amazon SNS: "Platform credentials are invalid" when re-entering a GCM API key that previously worked

We have been using Amazon SNS to send Android push notifications since April this year.
Pushes have sent with no problem, however there has never been any record of calls to the Cloud Messaging API in the Cloud Console (seems odd?).
Today I created a new API key for the Static Map service (unrelated) and renamed our Cloud Messaging API key (only the name, the key is the same). From this point no pushes have been sent, and trying to create a new platform application (or update the existing one) in AWS results in:
Invalid parameter: Attributes Reason: Platform credentials are invalid (Service: AmazonSNS; Status Code: 400; Error Code: InvalidParameter; Request ID:)
I have also tried manually making calls to the https://gcm-http.googleapis.com/gcm/send endpoint using the key which results in Unauthorized (401).
Interestingly, I can make calls to the above endpoint using the key I created today, however they fail on MismatchSenderId.
I can't see a lot of the previous options that the Cloud Console had (server / browser keys, etc) within the API Manager?
For those who are facing this in 2017, here goes a tip:
1 - Go to your firebase console (https://console.firebase.google.com/) click on your project (which you want to use for push notifications)
2 - Click on the "three dots" on the right side of your project name and click on "Settings"
3 - Click on "CLOUD MESSAGING" on the header tabs
4 - Copy the "Server Key" (this one is bigger than your API key)
5 - Paste on the "API Key" input of the AWS Form for "Create platform application"
PS: Note that this is valid only for GCM Push Notifications.
API Key management for GCM has been moved to Firebase Console.
You can create a new Firebase Project (or import an existing cloud project) and you should obtain a new Server Key for Cloud Messaging.
see the updated documentation:
https://developers.google.com/cloud-messaging/android/client#create-an-api-project
and the stack overflow question: Where can I find the API KEY for Firebase Cloud Messaging?
if you still have problems please contact:
https://firebase.google.com/support/contact/troubleshooting
I have been getting the same error when creating Amazon SNS platform application:
Invalid parameter: Attributes Reason: Platform credentials are invalid (Service: AmazonSNS; Status Code: 400; Error Code: InvalidParameter; Request ID:)
After reaching out to the Firebase support as suggested by Diego, this is the response I got from Google:
Hope you're doing well and thanks for reaching out to us.
I'm not really familiar with Amazon SNS and looks like their integration is still with GCM, not FCM. If your app implementation is still GCM, then you need to migrate with FCM in order to use the server key in the console. See the instructions here.
Also, Firebase has upgraded the server keys to a new version. We'd recommend to use the server key instead of the legacy server key.
I hope this helps. Let me know if you have any other concerns. Thank you.
This indicates that we'll have to change our app code. We were able to make this work for another app in out organization by creating a new firebase project and using the Legacy server key with Amazon SNS.
At some point we'll definitely upgrade to using FCM but at the moment we have a tight deadline.
Update:
So finally what worked for us is using the 'Server Key' under Project Settings --> Cloud Messaging . The app still uses the GCM implementation. Amazon SNS is happy with this key and generated a GCM platform push application. The pushes work !
Still confused about why the 'Legacy Server Key' does not work for one app but is ok for the other. But I am not digging into it any further.
For those starting a new project and wondering why it is still invalid, make sure the application Key restriction is set to Android apps. In my case, it was at only set to None and when I switched to Android apps, it worked after 5 to 10min after updating it. You'll need to add your package name and SHA-1 certificate fingerprint.