I am looking to implement push notifications in my app. I have already sent notifications from inside the application's context, but I want the user to receive notifications when the app isn't running. For example, you receive a Twitter or Facebook notification when you have a new message, but the Facebook app isn't open or running. I will be reading data from a server. When the server sends out a message, I want the user to get the notification, whether the app is open or not. I have looked at Service but couldn't find anything promising. Any ideas?
Implement Google Cloud Messaging in your app. This works by sending push notifications through the Google Services, which are almost always active on an Android device. These services will then broadcast the notification to your app, and you can handle and use the data once you have received it from the Google Services.
Related
I am trying to send a push notification when user is going to uninstall my Android app. My idea is to use Firebase Cloud Messaging and Google Analytics for Firebase Triggers. In order to be able to use triggers I have been marked "app_remove" event as conversion in Firebase Console of my app. It is possible send notifications using Firebase Cloud Messaging triggered by a Firebase function as described in this question, but when my app is uninstalled It will not be able to show incoming message from FCM as a push notification. It is possible to setup the incoming message to be displayed as push notification even my app is uninstalled?
It is possible to setup the incoming message to be displayed as push notification even my app is uninstalled?
Not possible.
When your app is uninstalled, the corresponding registration token tied to that specific app instance is also invalidated.
The registration token is what FCM uses to send messages to the corresponding device, if invalidated, FCM will no longer have any way to send messages to that device.
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?
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've implemented Firebase Cloud Messaging in my android app.
Is it possible to turn notifications off from my application settings screen?
It was possible with old GCM as we have broadcast GcmReceiver and we could handle it ourselves.
Now we have only FirebaseInstanceIdService and could handle it only when app is in foreground.
How we can handle it when app is in background?
Is it possible only to disable Firebase Cloud Messaging only for some category of notification inside app or this should be done on the server side?
You can manage whether or not notifications are displayed by always sending data messages from your app server. The Firebase console always sends notification messages, which are the types of messages that generate notifications automatically when your app is in the background. So if you want full control of when notifications are displayed use data messages which are only available from your app server, not yet from the Firebase console. See more on message types here.
I came with the solution to send request to the server if I need to switch on/off some type of notifications. And if send request to switch off some notification server will no longer trigger FCM server to send notification to the device
I was wondering if there's a way to send a push notification to a device from an android application that I developed or not. Also, if it is possible to develop my php server in a way that it would request a push notification to be sent to a specific device. I have already tested the SDK with my application and it receives the notification if I sent it from mixpanel.com. I just want to make the thing automated for convenience.
I'm trying to implement an application with a messaging feature and need to notify the user that will receive the message when they receive it. I read a lot about GCM and there doesn't seem any good documentation out there and everything doesn't work no matter what and I always get errors. Mixpanel should do the job, but in order for me to be able to send push notifications, I have to be logged in to their website and use the website to send the notification. I also tried to use HTTP request and send a request to the URL that sends the push notification, but I need to be logged in and it just doesn't work.
Any help would be much appreciated as I have to get this application done as soon as possible!
Thanks
You can get Mixpanel to send your push notifications automatically using the "Notifications" feature- you don't have to log in to Mixpanel every time. You can set up the notifications to be sent based on a user's properties. If you want to send a notification based on some event in your app, you can send a people analytics update to Mixpanel when that event occurs.
So suppose you want people to receive a push notification to their mobile device every time they sign up in your web app. On the "Thanks for signing up" page of your app, you'd put something like the following:
// Assuming you've added the Mixpanel JS snippet to your page
mixpanel.identify(SOME USER DISTINCT ID);
mixpanel.people.set("Signed Up", true);
Then, you could set up a notification in Mixpanel with "Signed Up Is True" in your Mixpanel project. The next time you set a user to "Signed Up", they'll get a GCM notification.