Notifications in Notification Center disappearing after opening one of them - android

I have a server that sends users many push notifications at any single time. Let's say 5 notifications are send to the phone. If I open one of them, all other notifications disappears.
How do I make the only one that is clicked, disappear. I look through the tutorials and done everything correctly. Is it something to do with the badge number or do I need to assign a special ID to every notification?
I can't find any solution on the web and I am surprise no one else faces this issue.
Ps. I am using Ionic Framework to build my app

" I am surprise no one else faces this issue."
Many many people have faced this same issue, its a mystery why Apple don't add more functionality in this area after so many years, but the situation is that you can't programatically delete just a single notification. You either delete all of them or none of them.

Related

Set app icon badge number on notification while app is not runnin with expo managed

I am having some issues displaying the number of notifications on badges on Android while using expo managed workflow.
I want the badge to update when the app is killed.
On IOS is working fine by setting the badge variable a number but somehow on android i only get a little dot that is telling me that there are unread notifications but no badge is shown.
This is how it should display:
But i am getting only a dot on the icon like on this example:
My question is that by using the badge variable should while sending out push messages from the backend should this be working on android aswell and i am messing something up or do i need another approche on android?
Any suggestions are welcome since i cant find any answer on this and been searching for days now.
Many thanks,
Trix
Android notifications icon works different than on iOS because these are just one color, with transparency.
So when you reference the icon image make sure it has the transparency, if not, all the form is filled.
Also check your app.json to add this:
https://docs.expo.dev/versions/latest/sdk/notifications/#custom-notification-icon-and-colors-android-only
https://docs.expo.dev/versions/latest/config/app/#notification

Recieving Notifications

So I have this idea of an app that would get all youtube's notifications for the day and puts them all in one page and give you some functionality over them like adding to watch later and maybe not interested and some others all in one click, in addition to that i would be able to make better notification tiles you know the default one isn't that good and i've seen better, I thought about it for a while and I think i am going to go about it this way:
1- stop youtube itself from sending the notifications.
2- making the app get this day's uploads and listing them.
3- making the app send the noti... in a better looking tile.
4- adding the "Other functionalities".
But..., i've looked around for notification support on the youtube api page and found nothing useful.
Is there any api or anything that would help me in this, i am using android studio BTW.

Ionic / Cordova trigger app action when app isn't in foreground

Original Question (Listen to hardware buttons press)
I am wondering if it is possible to listen to the hardware buttons of a phone using Ionic / Cordova.
The important thing is that this should also work when the user is not currently using the app like somehow through a background service?
Basically I want to take a screenshot when the user presses the volume down and the power button at the same time in a hybrid app using Ionic. The app then offers to edit that screenshot or save it directly.
I have done some research and found the cordova events to listen to those buttons. I also read that the pause event should be fired when the power button is pressed. Anyhow, I don't think listening to those events would work outside of that app?
Original Question Conclusion
After some more research I conclude that this is not really possible using Cordova / Ionic. Even the native implementations of this problem seem to be more of a hack than a clean solution. The reason for this is, that the app currently on top should have the control of handling the various button events. You could interfere with another app and you always need to run a background service. Anyhow, all the solutions I saw seem too dirty for me.
Updated Question / Reevaluation of the problem
Basically I want to take a screenshot when the user presses the volume down and the power button at the same time in a hybrid app
using Ionic.
If I can't solve the current problem I have to rethink it. So:
Actually, I just want the user to have the ability to take a screenshot in a way that offers a good usability experience.
There are various ways I can do that as an alternative to pressing two hardware buttons simultaneously.
Option 1: User presses a button "Take screenshot" -> the app goes in the background, a screenshot is taken from the underlying app, the app comes back to the foreground.
AFAIK this wouldn't even work in iOS, only Android offers a "draw on top of other applications", so in iOS the screenshot would simply be taken from the home screen in all cases...?
Option 2: User presses a button "Take screenshot" -> the app goes in the background and a notification is pushed.
This notification could say "Tap to take a screenshot". The notification panel (which is always drawn on top of other applications) disappears, the screenshot is taken and the app pops up. This could be done using Local Notifications and listening to the on clear, cancel etc. events.
The notification could even have custom buttons using OneSignal (see Action Buttons). One button could say "Add screenshot", another one could say "Done", so the user could even take multiple screenshots at once.
Option 3: A button could be added to the shortcuts that triggers the take a screenshot action. I don't know if that is even possible and if that works on all devices.
I would say the best solution would be to go with Option 2: Custom Action Buttons on a Notification. Notifications should be a must have on all devices and should always be drawn on top of the current app. So the user just swipes down the notifications and presses a button to take a screenshot.
I don't really have any prior knowledge to this topic so I would be glad if somebody could confirm or improve my thinking process.
Edit:
I have done a bit of research into this, mainly just to satisfy my own curiosity. I came across this plugin
https://github.com/katzer/cordova-plugin-background-mode/blob/master/README.md
It allows you to carry out task in the background.
Please note this from the readme file.
Store Compliance
Infinite background tasks are not official supported on most mobile operation systems and thus not compliant with public store vendors. A successful submssion isn't garanteed.
Use the plugin by your own risk!
This probably isn't a big deal on Android but there is an open issue with regards to Apple app store submissions being rejected. Read through the issue to see how others over one this.
https://github.com/katzer/cordova-plugin-background-mode/issues/122
Original Answer:
If you want to take a screenshot there is this plugin:
https://github.com/gitawego/cordova-screenshot/blob/master/README.md
Maybe you could listen for some other events whilst using the pause listener. If they are activated then using the screenshot plugin referenced above call:
navigator.screenshot.save(function(error,res){
if(error){
console.error(error);
}else{
console.log('ok',res.filePath);
}
});

cannot open links sent in sms text messages

im sending links via sms
like so:
hello, please click on http://example.com/Axcsy
some of the users call back with a problem that they cannot connect,
after inspected i realized that the link has been cut after they pressed on it.
so when they press it they get to http://example.com,
when they copy paste the entire link it works ofc...
is this a known issue or some setting that they changed?
I don't know of any issue that can cause this.
All i can think of is that they didnt click on it and just copy pasted it.
Note: it happened with only a few users (maybe 5 out of thousands), it has nothing to do with model type or android/IOS version (as far as i know, i checked with users that have the same model...)
if anyone has any clue why this is happening please answer,
thanks to anyone who replys
The users are probably using a text messaging app that causes this problem. Many users do not realize that Android can have different text messaging apps - and therefore don't realize they can change them.
Some of your users may have deliberately changed it and can tell you what app they are using, and they could then tell you so you can contact the developer. Even a provider's default app may have been created wrong or has a bug.

Downloads, Shown in notification bar?

As far as I know we can create notifications in Android using Notification Manager + remote Views.
I am Creating a notification for downloading Mp3 files. And I want an animations beside It. So far I have learned from forums that it is not possible.
However I saw A video for an android App which downloads and displays animation beside it while downloading it. Link: http://www.youtube.com/watch?v=yNcs-sS2nFU&feature=related
Moreover its the same animation used by the browser. How can they do it?
If any one suggests using level drawable for me, Please also suggest still I have to send a whole remote View to the notification manager with the same Notification ID. It will override it. That gives a animation like thing if I do it again and again. Is there no way to update remoteviews without sending the changed remoteviews to Notification manager.
WHY, I dont want the above mentioned animation effect?
Because It hangs the android. If the updates are sent more faster then 2000ms.
This question is also asked elsewhere at stackoverflow but never been answered.
The answer to all our problems,
http://developer.android.com/reference/android/app/DownloadManager.html
There is a built in download manager in android.
My guess is that particular animation you are seeing (the downward moving arrow) is provided by the system. I don't think you will be able to place your own custom animation in a standard notification.

Categories

Resources