after subscribing endpoint to token is this disabled then how to detect in aws sns - notifications

I added one token in aws sns , generated platform end point for that. and subscribed that end point to Topic. now again reinstall app , we got another token for same device. if We not subscribe that token to topic then notification sent for topic is not received
Why we need to resubscribe for same device?
and if we subscribed that to topic then topic will contain 2 endpoint subscribed one is new and other is old how to find that old disable /unused endpoint , to unsubscribe from topic
This also causing multiple endpoint for same device get subscribe causing slow on notification, how we can prevent this , any way to remove unused and unsubscribe endpoint from topic
Can we get aws sns mobile pushnotification without device token?

After reinstalling the app, the phone creates a new token that must be re-registered. This is not AWS creating a new token for the device.
I'd recommend looking over the best practices for push notifications.
The recommended way to remove subscriptions pointing to stale endpoints is to use mobile app events - in particular, "Delivery Failure", which will tell you which endpoint and subscription the delivery failed for, so that you can remove it.

Related

WhatsApp messaging webhook does not work in production mode

I am trying to create a connection between our WhatsApp Business account and our website where we gather all messages sent to our business on different channels (through our own app, text, WhatsApp, ...).
I've followed this tutorial (https://developers.facebook.com/docs/whatsapp/cloud-api/get-started) and have everything set up: our WhatsApp Business is working correctly, I've added a Meta App and I've set up the webhooks with a connection to my node.js backend.
When I click Test next to the "Messaging" webhook, I receive the message on my node.js backend and website. So I know this side is working as it should.
I've then used the Graph API to subscribe my Meta app to the messages with the business id of the WhatsApp with the correct permissions. When checking the subscribed apps with the {business_id}/subscribed_apps endpoint, I can see my Meta app. So I believe everything is set up correctly.
My Meta app is also set to "production".
However, when I try to send a message with my personal WhatsApp to my business WhatsApp, I receive nothing on the webhook.
I checked the logs on my server and nothing is being received, so I know it's not an issue in my node.js backend.
Is there something else I need to do to make this work? Does the Meta app need to be verified to use the webhook in production? If so, how can I do this? The guide for verification says I need a platform and login insctructions, but the Meta app is really only a webhook without an interface.
Thanks in advance.

Firebase Cloud Messaging doesn't notify when application is running

I want to know why Firebase Cloud Messaging doesn't send notifications when the app is running?
I started my application and tried to send a message. When I closed my application, it notified me. But when and I opened it and sent another notification, it didn't notify me, but it did trigger onMessage.
Is it possible to notify me when my application is running?
Firebase Cloud Messaging has two types of messages: notification messages and data messages.
Data messages are used for delivering data to your app. They are always delivered to your application's onMessage handler.
Notification messages are used to show a notification to the user. When your app is active, the messages are delivered to its onMessage handler, so that you can display the notification inside the app. But when the app is not active, notification messages are handled by the system and not delivered to your app's onMessage handler.
It sounds like you're sending a notification message. If you always want the message to be delivered to your applications onMessage, you should send a data message instead.
Also see:
the Firebase documentation on message types
Firebase onMessageReceived not called when app in background

Gcm with appodeal

I am using gcm with appodeal in my app and when I am sending the push notification the for the first push was successful but phone is not receiving the notification and after that error is there while sending push that device is not register. What to do in this situation please help me.
Is it iOS or Android ? I had the exact same issue just yesterday with iOS and all I had to was to create a development provisioning profile and set it up properly in xCode. I hope that helps you.
I think for you to verify that your app can send and receive messages, client apps must register with GCM.
To register with GCM:
1.The client app obtains a registration token using the Instance ID API. The call to this API must have the authorized entity set to your app server's sender ID, and the scope set to the appropriate value for GCM (depending on your platform). Refer to the API reference for full detail on this API.
2.The client app passes the registration token to the app server.
3. The app server saves the registration token and acknowledges to the client app that the process completed successfully.
This thread may also provide further insight as to why you are receiving the device not registered error.

Should i backup GCM registration ID with google cloud?

Is it advised to backup GCM id using android cloud back up ? i am storing the GCM id in a sharedpreferences so i dont have to keep registering.
if i backup this GCM sharedpref and user changes devices do i need to update it to a new registration id ? Is the registration ID device specific ? What happens when user changes devices and backs up ?
I tried and read this from the docs:
You must exclude any device specific identifiers, either issued by a server or generated on the device. This includes the Google Cloud Messaging (GCM) registration token which, when restored to another device, can render your app on that device unable to receive GCM messages.
From the docs i found my answer that the reason this should not be done is that it can intrefer in the apps intialization of gcm and it will not try to get the GCM id if its already restored from a new device that restored a old registration id.
Handle Google Cloud Messaging
For apps that use Google Cloud Messaging (GCM) for push notifications,
backing up the registration token that Google Cloud Messaging
registration returned can cause unexpected behavior in notifications
for the restored app. This is because when a user installs your app on
a new device, the app must query the GCM API for a new registration
token. If the old registration is present, because the system had
backed it up and restored it, the app doesn't seek the new token. To
prevent this issue from arising, exclude the registration token from
the set of backed-up files.

Android App push notification with AWS (DyanmoDB) and GCM

I have android app like twitter. I want a push notification on User1 app when User2 follows User1.
I have AWS (dynamodb) as backend and integrated with GCM. I am able to publish message from AWS sns console manually also. But i want norification to be sent automatically when someone follows other guy. Right now my app directly talks with DynamoDB there is no server in between.
I want to know to publish notification programatically should i write server where i should make a call to update DynamoDB (instead of directly updating it) and publish message to GCM. OR User1's app itself should publish a message for User2 ?
I need to know very urgently.. I could not find any explanation of that sort anywhere.
Thanks in advance.
You should implement a backend server and your app only communicates with your server.
Your app requests to your server to send a message to another user, and the server is responsible to update in the DynamoDB and tell SNS to send a push.
Hope it helps.