How to check if “show notification” is enabled?
My app is integrated with parse.com and whenever it gets a response from parse.com, it generates a notification and shows it to user.
I need to know that if user has disabled "show notification" checkbox. I have to show a dialog as disabled to the user while trying to login. I haven't used notification service into my app.
Please make me suggestion on how to solve this.
When you know that your app is sending out a push notification you can check if it is in the Notification area. This is assuming your app's minimum SDK is 4.3 . Basically you are checking all active notifications to see if your notification is within the active notifications.
http://developer.android.com/reference/android/service/notification/NotificationListenerService.html#getActiveNotifications%28%29
Related
First I don't mean receiving notifications from OneSignal or Firebase I mean allowing notifications like Google Chrome when you go to website and it ask you to allow receiving notifications. Any help? Thanks in advance.
Firstly that prompt you were saying is just come in website in PC brower/ Mobile Browser or in Android webview.
So, doing in webview, it won't ask you because in mobile there is no such permission you will needs to confirm, by default it will be enabled,
But yes in mobile you do need handle the notification and show in notification tray.
Hope you got the understanding of how it works
I am facing issue in my app regarding doze mode. I am making a chat application and when app is in backgroud during doze mode and receive any message . Device does not show notification in orea.
I have followed the proper procedure for OREO notification by building channel for it.
I need to find if there is a way to whiteList my app from doze mode so that I can have notifications. Or any other process to optimize notification building.
I do not need to whitelist my application to get notifications in doze mode. I recommend to look at your notification to see if you can find the issue there.
Some tips:
Send a notification, use the notification field. If theres no notification field it will be handled as a data notification. Data notifications are delivered when the app starts again.
Set priority to high.
Maybe use time to live = 0. That will make firebase to try harder to get it delivered. But it will be lost if it fails.
Hard to give you more direct advice when I do not know where you are sending the notification from.
https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages
The app is fetching alert data from server. What I have to do is display the notification if app will get new alert. This should be happen even app is closed. Previously, I have worked on push notification where server is used to display the notification. But here I don't want to use push notification. So is there any way to achieve it?
Use the Notification API. Notification is a message you can display to the user outside of your application's normal UI. When you tell the system to issue a notification, it first appears as an icon in the notification area. To see the details of the notification, the user opens the notification drawer. Both the notification area and the notification drawer are system-controlled areas that the user can view at any time.
You might require a Service to accomplish your needs. Use a Service with the mentioned Notification API to send notifications even when the app is 'closed'.
no other way to this without using push notification and GCM
I'm sending push notifications on devices in Java with Javapns.
When a user uninstalled my app and I send a push to him, I'll find this user in the feedback service, that's ok.
But how it works if the user disabled my app notifications ? How can I know it on server side ?
The app can know it (with UIRemoteNotificationType) and warn the server with a get/post but is there a way to know it on the server ?
The doc isn't clear enough about push notifications sent and user deviced push notifications disabled
You can not. Except for the feedback that you described, you will know nothing. Even if the user installed your app and enabled notifications, it may never get the notification and you won't know about this.
i create an application on my android device and i want run it when i receive a pushover notification. After i want passing the notification's text to my app. Is it possible?
thanks a lot
You make an application which subscribes to the notifications using
NotificationListenerService in Android 4.3 or Accessiblity Events in older versions of Android. See the following SO Answer for more information.
Also see the following example.
Then in either onNotificationPosted or onAccessibilityEvent your application should triggger your other application to launch using the method described in this SO answer.
This would allow you to start an application when any status bar notification was received from PushOver, and by filtering it to only notifications related to a new pushover notification, you would start an application when a new pushover notification was received.
In order to have the notifications text passed to your application or to filter based on the specific contents of the notification, you would need to subscribe to C2DM pushover messages which is protected by signature level protection, so without consulting the creators of pushover I don't believe that is possible.