I am currently developing an app where insistent notifications are required. However, I can't seem to get them to work unless the app is open. Is there a way to get insistent notifications connected to the notification channel, even when the app is not open? I'm using a Windows Service to curl the notifications. I'm developing on Oreo. Thank you!
Related
I'm making a push notification service using OneSignal API, the problem I stuck at is following : Notification is being received perfectly, but it doesn't wake up my android phone. As i searched in documentation, for IOS, you need to pass content_available : true, to wake it up, but what for Android? Are there something else i need to pass, to wake it up? Using nodejs and express as server. Thanks for answers :)
I have an app I'm working on that isn't yet compatible with Wear. Is there a way for me to block notifications from being delivered to a user's smart watch? The app has a persistent notification that I do not want to display until the wear module is ready.
If your using notification builder, there's an option to setLocalOnly.
Development docs :'setLocalOnly(boolean localOnly)
Set whether or not this notification should not bridge to other devices. '
Notification notification = new Notification.Builder(mContext)
.setContentTitle("New mail from " + sender.toString())
.setContentText(subject)
.setSmallIcon(R.drawable.new_mail)
.setLargeIcon(aBitmap)
.setLocalOnly(true)
.build();
Not tested it from the phone but I know it works with stopping my wear notification appearing on the phone.
I'm building a simple motivational quote app that generates a random quote from a MySQL database. The app works fine on mobile and I want to sync the quote message to a Wear device. I'm using MessageApi to do so and used this tutorial to set it up: http://android-wear-docs.readthedocs.org/en/latest/sync.html.
However, the message functionality only works when the app is running on the host device. I need to launch the app on Wear alone and still be able to receive the message from the mobile device. I thought of running the same application on the Wear device where it will run an httpconnection on it's own but from what I understand this is not possible with Android Wear.
So my question is, is there a way to open an app on a Wear device that will trigger the mobile app to open in the background and hence receive the message that way?
Your mobile app can implement WearableListenerService. In that service implementation, you can listen to messages that are sent to your phone from your companion app on a wear device (when such message is sent to your phone, the framework on your phone starts up your service and passes the message to it). You can then implement the logic you need in that service (fetch a quote, etc) and respond back to your wear's message; when its work is done, that service will go away on its own. For this to work, your wear app needs to send such message to your phone app upon start up (or whenever you see appropriate in your app). This approach should work and probably is the most appropriate approach for your use case.
I use gottox/socket.io-java-client on android chat app.And Now I want to use socket.io as a background service.In chat app If a new message (when chat app is closed),send a notification like "new message on chat app-click here if you want to see.
How can I do that? I did a chat app with node.js,gottox on android.But I need this app work as a background service on phone.Do you have any plugins or examples?
A service or any other Android component can be closed by the operating system. The solution is to use Android notifications to wake up any component.
I'm a newbie to Android development and I'm interested in two things which is connected to Google Cloud Messaging.
Does Android absolutely kill applications if they run for a long time in background as iOS does? And if so will I receive GCM notifications after my app was killed by Android?
Is there some difference between Force Close (from the settings menu) and when the app is killed by Android? And if I do Force Close will I receive GCM notifications?
1 - yes, but if you install in your manifest a broadcast receiver that listens for the gcm, it will triggered anyway. What you will do with that event depends on your app. A common practice is to start an intent service that handles the message. It's up to you to make interact with the activities of your app.
2 - From android 3.1, if the user force closes your app, it will stop to be notified of any broadcast until the user does not start your app again. Check "Launch controls on stopped applications" here for more details.