PubNub + Parse integration. Is this ok? - android

We are implementing a mobile app which let users share to-do lists. The idea is to have as little server administration as possible and obviously keep cost down.
For user management and push notifications we will use Parse.com with Cloud Code and PubNub for real time data delivery.
Every user will log in with it facebook' s credentials and subscribe to a read only private channel that only him can read. Every time he create a new to-do list to share with his facebook's friends, the app will make an API call to CloudCode, with it's identity, the data to share and a list of friends. In CloudCode the data is pushed to the PubNub private channels of the list of friends.
In addition in CloudCode the idea is to use PubNub Presence and if the user is offline, send a Push notification.
Is this implementation ok? I'm new to both services and trying to learn. Thanks!

PubNub is appropriate if you are trying to implement a realtime app such as a chat application or a GPS tracking application. But in your case, I think you may not need PubNub's features at all. You can have the afore mentioned functionalities using Parse.com only. The parse push can be used in both the scenarios.
When the user is logged in, and is using the application :- Receive the push, suppress the notification and update the UI with the newly received data.
When the user is not online or logged in, then simply create a notification and add a click listener activity for it.
The reason why I suggest to remove PubNub (for this particular application) is that, PunNub has a different pricing model for loading history. On the free plan, you are limited to one day of message history. On the other hand, you can run this app's backend on Parse.com, almost free cost.

There's nothing in the architecture you describe above that Parse can't handle, including the ability to support Facebook login and external service calls via Cloud Codes Parse.Cloud.httpRequest(). It will do it and do it well thus the answer is yes, this is ok.
Go forth and Parse.

Related

Notify my users automatically using firebase

I designed movie program that let user to select specific movies to let him follow any new news about it. For any important article i notify my user using firebase notification but how to make it automation to notify any one of them about any specific movie or category ?
according to my googling i can do that using google app engine but i am not sure !
There are multiple routes to go about what you are looking for. All of them will require you to set up a server, either on app engine or something similar, that continuously updates your database with new information. I would not rely on just data change events on your database in your app to do notifications though. I would look into Firebase Cloud Functions as well as Firebase Cloud Messaging where you wait for something in the database to change with a function, which then pushes the notifications with cloud messaging.

How do I send user to user notifications with Firebase programmatically?

The Firebase Console allows us to send notifications to single users, groups, users subscribed to topics or to the entire user base. Is there any code that allows us to directly send notifications in the same way, but programmatically?
For example, if I had a list of users (containing their Firebase UIDs), if I click on one of the users, could I send a notification to that user through Firebase the same way the console allows us to send a notification through the console?
This Firebase Blog uses the Google App Engine Flexible Environment to actually send the notifications, but it requires a free trial and costs money.
This Quickstart doesn't really show how to send user to user notifications. It focuses on the subscription-based notifications, but this isn't really what I need.
Is there any good way of doing this with Java/Kotlin and the Firebase API?
FCM doesn't support you sending message directly from Android app to Android app. However, this is a workaround to solve your problem:
Create a firebase cloud function. Listen a special path in firebase database
Android app 1 push a data (maybe Android app 2 ID) to this path
Firebase cloud function process data, determine who to send notification (Android app 2).
Firebase cloud function push notification to Android app 2.
ref: https://firebase.google.com/docs/functions/use-cases#notify_users_when_something_interesting_happens
In a basic concept: we write our server to get action from firebase database and decision to send notification to other user by FCM. This our server can write with NodeJS or using Firebase Cloud Function (above)
Guide how to using Nodejs is here: https://firebase.googleblog.com/2016/08/sending-notifications-between-android.html

Android push notification without firebase

I want to send android push notification to the selected user without using gcm or firebase. The application is already built without firebase. Now I need to integrate push notification too.
Question:
How it's possible without firebase?
Actually I want a feature that, when an admin update the value in the one field in database table of particular user, the that user will get a push notification regarding the update. How it is possible?
The way is to create custom Service https://developer.android.com/reference/android/app/Service.html , which is holding connection via socket or polling some remote server with intervals.
But, I suggest that Firebase service is more advanced and optimized in battery consumption and, particularly, in utilizing the sleep mode. It's not trivial to make a service which will have fast response and CPU consumption. I think that a custom service development will lead to native (C++) coding of networking routines libs.
Also, take into account that Firebase provides own Authentication service with ability to seamless convert your anonymous user to registered. There is a lot of pros of Firebase services. And cons are: your users have to install Google Play Services, if your app will grow - you will pay to Firebase.
Look here Android push notification without Google service
It's possible using VAPID authentication.
Google for VAPID and you will find a very tortuous road that could lead to the answer you are looking for.
another option is Gotify. Gotify is self-hosted open source notification solution that you can use it to send push notification to your android app without need of Firebase.
with help of UnifiedPush you can receive push notifications in your android app.
you can easily host Gotify server on Docker and use it's Api or cli,... to send notifications.
here is a good article about Gotify: https://www.linux-magazine.com/Issues/2020/230/Gotify

Implementing FCM (Firebase Cloud Messaging) on a MVC Web App

I am developing a MVC Web App. The app will provide a platform for people to sell products and allow people to then search for an view these products.
I have no experience of what functionality Firebase FCM can provide. So my two questions are:
Can FCM be added to a MVC App to send push notifications to Android and IOS phones when a triggered by an event e.g a new product gets added to the web app
If it can be added to the Web App how customizable are the notifications e.g. can a notification be sent based on different type of events e.g. can different notifications be sent when different types of products are added to the web app?
Any advise would be helpful!
Yes... but it's up to you to write the code to do this. That is, you'd need to have some kind of process on your side (probably on a server) that's observing the data powering your web app, or your web app could do the work itself to "trigger" this process when it changes. (It really depends on how everything is structured.) This process could then submit a FCM notification that would go to all your mobile clients.
There is currently no way for this to happen automatically. That is, if you're hoping for some kind of "Hey, Firebase, send off a notification through FCM when you notice that a new child is added to your database" functionality, that's something that does not currently exist.
Since you'd be writing the code to create the notification, you can customize as much as you'd like. :)

Having Some issues with google cloud messaging api for android

I am new to gcm api for android and have for some time now i have being working on an android app to allow chatting between two users of the app. The app is such that a chat can only be initiated when one user opts to contact the other user. But my confusion comes in the manner i would be able to create a chatroom for these two users and for the other user to be able receive messages. since i found out that each user must subscribe to a topic inorder to receive messages in that topic. Would i have to subscribe all users to all possible topics or what? that is my big question but it seems it would have so much overhead considering i have 1000+ users.
Please i need all the help i can get here. Thanks
Would i have to subscribe all users to all possible topics or what?
GCM topic messaging allows your app server to send a message to multiple devices that have opted in to a particular topic.
It is not a requirement but it can ease the work for the server to send messages. In this tutorial, you will see that they have created a chat like environment using GCM without using the topic function.
BUT consider the effects on your server like how will it behave on the potential load when you use the topic messaging, especially the the message will trigger an interaction from the user to the server.

Categories

Resources