Firebase push notification using node js and polymer web app - node.js

I want to send device push notification to android app. Here is what I am doing:
Created a webapp server(node js) and client code is written in polymer.
Deploying this webapp to android device as android app using some third party android container(Predix Mobile).
The third party container takes the web app and deployed it into android device as android app.
The third party web app doesn't have any plugin which can generate device token used to send device push notification using google firebase.
I have a login page in my web app, when I login, I want to generate the device token. But I can't find any help how to do that, because my client code is written in Polymer.
I will send that token to my server code which will be deployed to cloud, the server will do a post call to push the notification to device.
Is there a way I can achieve this?

I used OneSignal to do something similar in a project.
https://onesignal.com/
Your UI loads in a webview and you have full control of the MainActivity. In your micro service, you can make a call to the OneSignal API with the message you want to send as a push notification. You can handle the push notification in your MainActivity. You can send notifications to a specific device, a group of devices, or all devices running the app.
You can create an interface between your MainActivity and Polymer WebView to move data between them.
https://developer.android.com/guide/webapps/webview.html

Related

Do I need to access to different servers to implement the Web Push API on different browsers?

I am implementing a very small wpa. in this application, I need to initiate some messages to the client via the server.
I have checked the information about web push notification and technically it is possible to implement it.
But according to my understanding, I need a Push Service to act as a bridge between my App Server and web browser. Different browsers use different Push Service, for example, Chrome uses FCM, Firefox uses its own, and Safari uses Apple's.
So if I need to send this Push message, I must target the user in different browsers, and then App Server sends it to different Push Service Server?
Or furthermore, even if I can send a push message to FCM, Firefox and Apple's Push Service Server now, but the user opens it with Edge, I can't send it to him now?
Is it possible to deploy a Push Service Server by myself?

Communicate two ionic - angular apps through node server

I have two Ionic applications, and both use the same API served with node. What I need is that when one app sends a post request, the other app gets that post request and uses the information that comes from the request. How can I achieve this? I thought of listening for that particular post request, but I don't know if that's possible, or when the post request reaches the API, trigger some action in the server that sends the information to the other app. Is this possible?
You can use Firebase Cloud Messaging to implement this.
When one ionic application requests a service from your server by using HTTP Requests, the server will trigger the respective action and sends a push notification to your other app by using the Firebase cloud messaging service. Your 2nd app will capture this push notification by subscribing to a URL in Firebase.
For the server-side, You can use fcm-node module or Firebase NodeJS Module to implement this functionality. For the mobile app, you can use providers in ionic to subscribe to firebase cloud messages
A detailed guide on implementing push notifications can be found here

How to send notifications to iOS and Android using Python

I have created some code for sending alerts, for now only by emails. I was wondering if there is an easy way to send push notifications to iOS and Android mobiles using Python. Thanks a lot.
Without getting device tokens from the devices (iOS / Android), and without a valid APNS certificate for the iOS app, there is no way to send push notification to any app.
For iOS, device token and certificate is must.
For Android, a Firebase project has to be setup, and the device token has to be fetched from the app.
If you are the owner of the backend that the mobile apps are using, it is easy to send device tokens from the apps provided you have access to the Firebase project (for Android) and the certificate used (for iOS).

How to send Image from nodejs server to particular react-native mobile app client

I want to send image from node server to a particular react-native android app (client) specified by client_Id. App will have a facility to configure itself with some client_Id. I want to ensure the image will get delivered to the mobile with the specified client_Id. Suggest me which library/Modules/Protocols I should use.
I Want to achieve something like this

Which Google Oauth 2.0 Client ID type choose for cordova hybrid mobile apps?

I am developing cordova based hybrid mobile apps targeted for android and iOS smartphones.
Usecase: The application authenticate user and then would be accessing Google Calendar API's, and finally display user events on the app.
Note: I will be Using 3-legged OAuth and Google Data APIs without the client libraries.
Question
The Cordova-enabled WebView provides the application with its entire user interface, so what should be the application type in this case?
Since everything is going inside webview, so Shall I choose "Web Application"?
OR
Do I need to create seperate Applications type for Android and iOS
seperately?
Or can iOS Application Type work for both Android and iOS?
Please suggest what should be the proper approach to choose application type in this case.
Thanks!
It depends on how your app is setup. If you plan on handling all of the OAUTH processing on a backend server then you can use the Web application type, and you can have all the OAUTH work offloaded to the backend server.
If you do not have a backend server and will do all OAUTH processing on the user's device, then you should create both an iOS and Android client ID. For example:
https://github.com/EddyVerbruggen/cordova-plugin-googleplus
This plugin's documentation shows the creation of both an iOS and Android client ID to enable Google Sign In on a Cordova app.

Resources