Android App push notification with AWS (DyanmoDB) and GCM - google-cloud-messaging

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.

Related

Push API / Web Push: what is the behaviour if client is offline?

I just finished the Google codelabs about Push notifications and I have some questions that I couldn't find any answer yet.
Using only web-push library on the server (so no Firebase or anything), do we need to create a database in order to store the endpoint and the userId ?
What happens if the client is offline when the server sends a Push notification ? Does the client will get it as soon as he's online ? Is the notification lost ?
-> if the notification is lost would it be a good solution to create a database table containing each notification and the status (delivered, not delivered) for example ?
I even searched in the on the Push API documentation and on the web-push npm page but there aren't any informations about those points.

Buildfire: PHP API To send notifications

I am using php api to send push notifications to users using docs provided here
https://sdk.buildfire.com/AWSGatewayPublicAPI/#/push_notifications/post_push_notifications_schedule
Is there a way I can send notification to all devices which has app installed but not logged in?
Thanks,
Chandresh
You don't have access to send a push notification to all devices, the group_id is required.
but you can create a service in your plugin and subscribe the users to your plugin group, this way you can send a PN to all subscribed users.

How to Send Push Notification to Xamarin Android app?

I need to implement push notification to our Android App using Xamarin. Here is the process. We have web version which used by the Manager. The Manager creates and assign job to the driver. The App version is used by the Driver where it shows the list of jobs and processes of job until its complete. So, when the Manager assigned the Job to the Driver in the Web version, it will then notified to the Driver in the App version that "new job is assigned". Basically, both the web and app uses same database then we created an api(REST API in MVC C#) to connect and get data from the db to be used in the mobile app.
Can someone recommend to me which Push notification plugin(a plugin or nuget) should I use to do this? Currently, I have set up Push Notifications through App center & Firebase but not sure how this work.
Thank you.
I need to implement push notification to our Android App using Xamarin.
I would suggest you use Firebase for mobile push notifications for Android as it is a product by Google, and was made for mobile applications. For push notifications, you will be using Firebase Cloud Messaging also known as FCM. See to it that you are well versed on how it works before you start coding anything read the documents it answers most of your questions there itself.
The Manager creates and assign job to the driver. The App version is used by the Driver where it shows the list of jobs and processes of a job until its complete. So, when the Manager assigned the Job to the Driver in the Web version, it will then notified to the Driver in the App version that "new job is assigned". Basically, both the web and app use the same database then we created an API(REST API in MVC C#) to connect and get data from the DB to be used in the mobile app.
For this, you will have to check on how to work with Firebase using Rest-API. Once you configure the Rest-API and then apply your business logic to it things will be quite easier than you might have imagined.
Can someone recommend to me which Push notification plugin(a plugin or NuGet) should I use to do this?
My recommendation is quite simple, Do not use any sort of a firebase push notifications plugin!. I have had a very bad past with plugins and ever since then I never recommend fellow developers to use plugins until it is a well-maintained one. I would rather ask you to simply configure Firebase on the basis of the guides that are available online. Like the following Xamarin.Android guide for FCM. It is detailed contains everything that you are looking for and what else I would suggest is you check firebase related answers on SO and you will find that almost everything that is not available in docs is covered around here and in detail. Like the following:
How to handle Firebase Notification i.e. Notification Messages and Data Messages
Push Notification in android with firebase get token
How to send device to device messages using Firebase Cloud Messaging?
Receive push notifications on one android app from two Firebase projects

What could cause ti.cloud to stop display Android Push Notifications (GCM) in status bar

I previously setup an Appcelerator Titanium project with push notifications (as per my Stack Overflow question How to configure Android Push Notifications (GCM) in Appcelerator Titanium Dashboard?) and for some months my Android app has been receiving the appropriate push notification from GCM, but I'm now receiving reports that this no longer works from end-users.
The flow usually goes like this...
Android app sends android push token to my Java server
Java server persists the Android push token
Java server sets up Amazon Web Service SNS endpoint for GCM and stores this endpoint for later use.
(some time passes)
Java server invokes Amazon Web Service SNS endpoint with a GCM payload
Amazon SNS passes message to Google GCM
GCM passes message to ti.cloud / ti.cloudpush
Phone displays push notification
The app does receive the push notification and I display an application dialog to show the contents of the message, but NO system-tray push notification is displayed, whereas I thought it was doing this in the past. No system sound is played either.
I can see that if the app is not running, then when the push notification is received the app is launched, but if the display isn't on (or locked) then the message will not be discovered for some time. I really need the native/system push notification to be in the tray.
Does anyone know why system / status notifications are not displayed? Should it be when using the ti.cloud / ti.cloudpush for Android?
Thanks
Rob.

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.