I want to see what "events" it fire when I click the notification, and for some notifications, there is a reply textbox, I want to create a program that runs the same functions as pressing the notifications, how do I do that?
Related
I'm using https://github.com/zo0r/react-native-push-notification for local push notifications. It also includes an option to have some buttons on the notification("actions"), which I can press on.
However, when I'm getting a notification, to respond to that button(noti. action), the app should open(the only way I could work it around) and only then I can run my logic according to the action.
Because I have some troubles using react-native-push-notification for this(It simply doesn't work), I would like to implement this by myself.
This is the process I wish to have:
Push notification is showing up
The user clicks on the snooze button(same as an alarm)
The application is still in the background
The notification will be pushed again after some time.
What is the proper way to do such a thing? I have to run a background task that is fired when the user presses the snooze button. How can I use HeadlessJS for this? It is very easy to implement the snoozing logic with JavaScript, the problem is to fire it.
Actually the thing I want to achieve is, normally the shortcut icon badge count in android got cleared once the push notification popup is acknowledged by an user from notification panel, but instead clearing the count as above it has to be cleared only after the corresponding notification is acknowledged by an user within the app(for eg: if an user received a text message then the badge count will increased to one and once the user cleared the push notification popup form notification panel then the badge will also got cleared, but instead of that badge should be cleared only after the user viewed the message).
I tried the following packages.
https://www.npmjs.com/package/react-native-app-badge
https://www.npmjs.com/package/react-native-android-badge
Looks like you can use ShortcutBadge.setCount(0); to clear the badge counter!
I dont know what you use to display a notification on the android device itself, probably react-native-push-notification.
If that's the case, they also have a function for it:
PushNotification.setApplicationIconBadgeNumber(0)
You just need to run one of these functions when the event of a dismissed notification triggers, which may or may not need some java coding for achieve it!
I am having a hard time with push notifications to update an app, to send the push, is ok, using the notification, first I lost a bit of time to learn that you need the physical devices to test the push.
ok receiving the push done, but on a near update I need to create a push with buttons (ok, cancel), and hear that event, and acoording to the answer send the message back to the person that first activated the push, I do not know if I am clear enough.
The person will enter the app and perform a search on other users, he can select a few tags and aptions to search, when he clicks search, the server will locate every user in that area and send a push to the selected users, that will show a time limit or a countdown counter if possible and an ok(the user wants to appear on that search) and cancel button, if cancel is clicked, just dismiss the notification, but if ok is clicked it must answer the person who is searching with that user id, and I am a bit lost on how to perform that task, I do not even know where to start, sending the push is the only thing I knew I should do, but the rest of the idea is not clear on how to do it on appcelerator.
The buttons are so-called Interactive (Push) Notifications. They can be used in both local and push notifications. Simply include the category (which needs to be registered in the app) in the payload, e.g.:
{
"alert": "New content available! Download now?",
"badge": 1,
"url": "http://www.download.com/resource/asset.json",
"category": "DOWNLOAD_CATEGORY"
}
See:
Send an Interactive Push Notification
iOS Interactive Notifications
I wanted to know there is any method in android where user tap yes/no in notification status displayed in notification bar. And this response is received by my app?? something like inline reply
try this example
Determine addAction click for Android notifications
or this tutorial
http://www.vogella.com/tutorials/AndroidNotifications/article.html
My application adds a notification in the notification bar. Now when user clicks the notification, is there a way to execute some code inplace rather than control is redirected back to my app.
Let the user be in notification area after clicking this notification and the click does the work in some background task or service.
Is it possible to send a handler message in this case
Update to question:
If I wish to have 2 buttons in the notification. where would the handling code run
That should be an easy one. Just use an IntentService:
http://developer.android.com/reference/android/app/IntentService.html
and here the first tutorial I found on google:
http://mobile.tutsplus.com/tutorials/android/android-fundamentals-intentservice-basics/