Amazon SNS Push Service - used for friends request in android app - android

I have a question concerning the design of my app. I have different users, which I want to socially bound as friends. This requires a proper notification for the other user as well as accepting the request.
My question is how to do it with AWS? I have users stored in Cognito Identity Pool. Should I use push notifications informing the user about friend request? If so, how to send a push notification from one android device to the other?
If not, how else should I design it? And if I want to implement notifications inside the App is Push service still valid (encoding by Lambda, something like this?) or should I use something different?
Kind regards,
Grzegorz

In general you don’t want your app to have permissions to send push notifications directly to other devices. Assuming you have each users device tokens, using a Lambda function as you mentioned to send an SNS push notification to the potential friend's device which could then trigger a flow which could allow them to accept and link as friends (depending on how your friend flow works).
You can find some helpful SNS documentation at http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html. Mobile Hub can help you get started quickly, and will create an app that can receive push notifications, and trig (https://console.aws.amazon.com/mobilehub). You can also use Mobile Hub to add Lambda to your mobile app.

Related

Can I receive mobile push notifications from SNS without a dedicated app?

I want to setup some maintenance related messages that would be dispatched to Slack and ideally some mobile users via push notifications (avoiding SMS if I can). I already handled Slack via some SNS + Lambda combo, and I'm tackling the Mobile push part.
I was somehow hoping I could just subscribe my phone number to some SNS channel but I guess its not so simple yet...
If my understanding is correct, it is not possible to receive push notifications without an App, since the Cloud-to-mobile-push service actually needs a client running on the device.
Actually, from what I can read on the internet it would seem most articles and documentations explain how to setup push notifications inside some application along with other features (and basically the push notifications is just one feature amongst the others), and that the push notification is not an end in itself.
However, I am just interested subscribing to push notifications as an end in itself (I don't need any other app feature).
What is the way to proceed in this case ? Are there some generic apps that are made for this and would let me subscribe to any mobile "push-list" ? Are there some kits that let one easily make an app just for the purpose of receiving push messages ? Is there maybe a builtin way in Android/iOS to subscribe to a push list without downloading a different app ?
EDIT : I am in the eu-central-1 region. I have some serviced in eu-west-1 (sending emails to SES) but otherwise all my servers and alarms are in eu-central-1

Should I store Android device tokens for sending push notifications?

I am working on an app, which requires Android push notifications to be implemented.
I have decided to use Firebase Cloud Messaging directly; without using any other abstraction such as AWS SNS or Pusher.
I would like to avoid storing and managing device tokens in the backend, by using the following approach.
In the android app.
When the user logs into the android application, obtain device token but not send it to the server.
Subscribe to a topic that is based on a agreed convention, such that the topic is unique to that user.
On logout unsubscribe from the topic.
In the Server.
Whenever a situation arises to send a notification to particular user, send push notification to the topic, that is based on the convention.
I would like to know if this is a viable strategy to avoid managing device tokens ?
Case against using topics.
From the official docs.
Based on the publish/subscribe model, FCM topic messaging allows you to send a message to multiple devices that have opted in to a particular topic. You compose topic messages as needed, and FCM handles routing and delivering the message reliably to the right devices.
For example, users of a local weather forecasting app could opt in to a "severe weather alerts" topic and receive notifications of storms threatening specified areas. Users of a sports app could subscribe to automatic updates in live game scores for their favorite teams.
I see that topics are recommended, when multiple devices are to be notified. But I have decided to create a topic per user, this would mean most topics would end up getting subscribed by only one device; Is this approach ok ?
I see that topics are recommended, when multiple devices are to be notified
Yes, multiple devices that have something common to listen to, which is the topic. Topics are used for messages that could be received by the general clients since it is public -- i.e. anyone could subscribe and receive messages sent to it.
What is advised to use for multiple devices, but for the same user is to use Device Groups (see my answer here for tips on Managing Device Groups). However, if you don't mind the "topics being public" part, then your approach should be fine.
Yes, Here required device tokens if we want to send push notification whoever installed your app.
My research we can save device tokens in back end at first time installation of your app that is better according to my understanding so that we can easy to send push notification across all devices.

Android push notifications to a custom list of subscribers of a topic using Amazon SNS

I'm currently working on an application build on AWS. At first, the application was on Parse server and the push notifications were not a problem but then, when I migrated to AWS I encountered some issues with that.
As far as I read from this link http://aws.amazon.com/articles/9156883257507082 I learned that I need to create a topic to subscribe users by creating endpoints using the device tokens from where they are currently logged in.
I will have many users, and the notifications will be sent to all endpoints from a topic.
The problem is when I want to send a notification I want to exclude some users from a topic for receiving that, for example, when a user posts something I will not send a notification to him too. This is available also when I have a custom audience to send notifications to. I could create a topic for every event notification to be sent but I don't think this is a efficient method.
Is there a possibility to do that or Amazon does not even support this feature? Until now I didn't find anything on internet that can help me solve this problem and I hope I'll find here someone who worked with this.
Thank you for your time!
Plus : I also found a similar question here Send Push Notifications using Amazon SNS service but I still don't have a certain answer or some links about that.
From what I've found in AWS documentation, it states that
Send messages directly to a specific device by calling the Publish function with the device’s ARN. You can easily scale this to handle millions of users by storing the endpoint ARNs in Amazon DynamoDB and using multi-threaded code on the server.
Thus, to be able to filter users that receive notifications and not send bulk messages to all users subscribed to a topic, you need to send messages using the device's ARNs.
You can find more info here

Ionic - Push Notifications between two different Apps

I'm working on an Ionic project developing two different Apps:
1) The Companies App - Companies will be able to post new job opportunities.
2) The users App - They will be able to check for any role, if an user applies for a role, the Company that is offering the job, should receive a Push Notification.
As you can see, my problem is: how an App will Push to the other one ? Does Ionic have a solution for that? If not, there is another way to solve this?
Looking forward to hear from you! Thank you!
The whole point of push notifications is to give backend servers the ability to initiate communication and notify mobile devices with updates. This said, You have to do server side logic to achieve what you need, here is a sample scenario for your case:
Register your companies app to ionic.io, following the steps on ionic push quick start guide, when you register your app gets a unique ID that you can use from your server side code to send push notifications, sample code for python can be found in API Examples
Company A uses the companies app to post a new job that will be added in a database on your server. Company A can choose to subsbribe to push notifications, when they do, a unique token ID will be generated for this device, send this token to your backend server because you will need it to send the notification, check API Examples
User B uses the users app to apply for the job, his application is
propagated to the server.
Your server side code will determine that this job was posted by company A which is subscribed to push notifications, and will use the company token id, the application id, and the application secret key to send a notifications to the company on the companies app.

Client triggered Parse.com Push notification

I am creating a simple forum app for ANDROID using Parse. I am stuck at a problem related to notifications
For instance I want that when user A posts a comment in a forum app, user B (who subscribed to that post) will receive a push notification, can I do that using either client code, instead of handling it using Cloud Code, or the REST API? If not then how to I start developing the server side to use cloud code or REST API
Allowing users to send push notifications via the client is bad for security reasons. It's not incredibly difficult to get the application id and client key to an app. Anyone with that information will be able to create their own code that allows them to target whoever they want with push notifications if client push is enabled.

Categories

Resources