I am building an android blog app which requires an admin app to control and post and a client app, only to receive posts and notifications.
I have implemented the send notification part in admin app, (without any server code) but the notification only shows up in the admin app not the client app. I want that whenever a post is created, the client receives the notification.
How can I do this?
Related
we created a Chat application with a Client and a Server project.
Clients can send messages to the server and the server and the server forwards it to other Clients (like a Chat application should do)
FCM is implemented in the Client project. Users can send Notifications to each other.
How can I use the Server for sending Notifications? Can I just write the Code for sending Notifications in the Server project (Server does HTTP Request with User token etc.).
Idk about that because I think the project should be somehow registered to FCM to use the services.
I only find tutorials about sending Notifications from App to App, not from Server to App.
For example in this scenario:
User installs app, then creates account and gets confirmation email from the server
, then clicks on confirmation link (app is clossed or in background)
, then gets notification that the account is ready
I think this is not possible with using FCM only in the app project
I have a script on server which sends sms or telegram messages to users. I want to send sms when user is offline and send telegram message when user is online.
Is there any way to detect whether android user is online or not from my server (maybe sending request to already running some app?).
Note, users are willing to share some credentials if necessary.
Android OS version: Api 21+
Well, I created my own app.:
I used firebase cloud messaging to send notification (as it is lightweight and based on event-driven model) to devices from my app server. Byw, telegram uses gcm which is younger brother of fcm.
I send only data messages (only payload) to my app from my app server so that I can get my app notified about notifications even if it is in background.
When app receives notification, it sends upstream message so server knows that user has received message.
If server doesn't receive response from user within 5-10 seconds, then user is most likely to be offline.
I am new to azure and firstly i want to send push notification by azure portal, so i was reading this tutorial https://learn.microsoft.com/en-us/azure/notification-hubs/notification-hubs-android-push-notification-google-fcm-get-started
i have already a blank android app and i want to send push notification by that blank app so can i do it with that or i have to make a new blank app which should be configured with azure notification hub as described in above links point(Connect your app to the notification hub) after connecting with FCM ?
Please help me
It IS possible, but NOT recommended as your referenced documentation said as below.
This example of sending notifications from the client app is provided for learning purposes only. Since this will require the DefaultFullSharedAccessSignature to be present on the client app, it exposes your notification hub to the risk that a user may gain access to send unauthorized notifications to your clients.
If you are making your app for public purpose, bad user could get security key of push notification and could send spam messages. So, to address this issue, you need to create Azure WebApp to register and send push message.
Is it possible to create an app that can send notification to the user who does not have the same app installed on his device.
I have come acrossed 'Push Notification' service via GCM and FCM but it requires the app being installed on both the devices to communicate or send notification.
(P.S- No suggestion for web application to user mobile service)
You can use other means of communication like SMS or email.
No. Notifications even though coming from Android Google servers are part of the app environment. So you cannot send an app notification to non app users. If that was the case imagine getting app notifications from Amazon and whatnot.
But you can use some other means like mail, sending links of your app via mail/sending invites via mail or SMS.
I run Push Notification Sample code on Worklight server and its working.
Now i want to send notification from one device to another device so what are the required changes in the adapter?
The adapter XML:
<displayName>PushAdapter</displayName>
<description>PushAdapter</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>http</protocol>
<domain>https://android.apis.google.com</domain>
<port>8080</port>
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="2"/>
</connectivity>
Should i change domain and port and i have to upload the app first on google play so that i can able to recive or send notifications. And should i create a key for android device on GCM
Push notifications in Worklight (and I believe at large as well) are not sent from one device to another per-se; consider it this way:
You have two applications:
A managing app
A receiving app
User A is running the managing app - this application is able to send a request to the server, which tells it to send a notification to some other user(s).
User B is running the receiving app - this application is able to receive notifications.
All of this is not related at all to the Google Play store.
Yes, both apps will require a GCM senderId and Key values in order to have any Push Notification capabilities.
As for implementing all of this... there is no sample to do this, but you already have part of the solution (the sample app is able to receive notifications). What you need to do now is have the managing application be able to retrieve a list of / specific username(s), and create a procedure that will invoke a function to send the notification based on the username(s) you have retrieved.