Notification badge/counter in control app - android

I am working on a control-based (V2.0) SW2 app. Is it possible to set the badge-number (i.e. the notification counter) on the icon in the application view used in a notification-based app? I do not need anything else from the notification API, I just want to be able to set the badge-number and removing it after the user opens the control-based app.
Thank you,
Andrej

Unfortunately that is not currently possible without using both the Control and Notification APIs together. If you use both of them in your extension you may be able to achieve something similar to what you want but with the limitation that the extension will always start in Notification mode (this is a bug in the current implementation) so you wouldn't be able to go straight into the Control part of your extension.

Related

React native full screen intent notification

I have an app that needs to show a full screen notification even when the phone is locked or the app is closed, something like ubber, when the user orders a driver i want the driver to be able to see a fullscreen notification that shows the details of the order and some action buttons that might reject the order, accept it, or open some activity in the app like checking the users profile or something.
I don't want it to be just a normal notification because the whole buisness kinda depends on it, the driver needs to be instantly informed about the order and react to it, that can be best achived with implementing a full screen notification just like answering a call, it's a time-sensitive message.
Is this possible with react native and some push notification service like OneSignal?
After doing some research i found that this may be achievable with Android using services and full screen notification intent, but in ios it's more complicated since background tasks are very restricted in iOS.
So im just looking for some insight on how to achieve this or at least something similar, is it even possible to achieve something like this? Do i have to write some platform specific code for both iOS and Android?
ANY help at all is very much appreciated, thank you.

Background periodic task and notification showing

I was looking online for the best solution but couldn't find exactly what I wanted.
So, I am developing an app using React Native, and trying to make it so that even when the app is closed, once an hour a background task (which will do some fetching) will run, and at the end of it a notification (not a push notification) with a custom message will show up.
How can I achieve that?
Thank you upfront.
For Android you can use Headless JS which ships with RN. For iOS you'll need a package like react-native-background-task, which works with both. Android only projects you're probably better off just sticking with Headless.
You'll need react-native-background-task to perform the task you wish like fetching every hour, and then using some notifications library(i prefer firebase), you can show the notification to the user screen.
Also in firebase there is scheduling-notifications with which you can schedule notification showing on the screen (maybe you find a use case needing it).

What is this persistent in-call/in-progress bar called when a mobile app is backgrounded (iOS and Android)?

At least for iOS, apps like Spotify, Hangouts, and Google Maps have a way of showing that they're still active when in the background (when you temporarily leave them to check a different app, etc.). This typically appears as a thicker status bar in iOS.
Other variants:
What is this bar called, and is this possible to implement for Android? I have a video chat app (in both Google Play and App Store) that uses TokBox (essentially WebRTC), and it renders this bar already for iOS when backgrounded, but not Android.
The consistent way to indicate an ongoing phone call in Android is using a notification. The Android phone app also uses a notification in this scenario:
To prevent the user from dismissing this notification, you can use the FLAG_ONGOING_EVENT or FLAG_NO_CLEAR - see https://developer.android.com/reference/android/app/Notification#FLAG_ONGOING_EVENT
On iOS, you might want to set a specific Audio Mode and Audio Category to get the right status bar look.
See https://developer.apple.com/documentation/audiotoolbox/audio_session_services/1618405-audio_session_modes
and https://developer.apple.com/documentation/audiotoolbox/audio_session_services/1618427-audio_session_categories
Further, the Background Audio capability is required - otherwise, your Apps audio session will be stopped after moving it to the background.
To achieve an even more consistent user experience, you might want to integrate the iOS CallKit or the Android ConnectionService, see
- https://developer.apple.com/documentation/callkit
- https://developer.android.com/reference/android/telecom/ConnectionService
It can be implemented in Android by using a notification and adding a flag FLAG_NO_CLEAR
This is a link where this is explained pretty clearly

How to remove default action(BlockApp) in android wear notification?

I am working on Android wear notification. I am able to add action. Everything works fine. But I wanted to avoid the default action(Block app) which you find it as the last action item in all android wear notification in the notification.
How do I remove the default action?
You can't do that. They introduced the feature on Android 5.0.1 and it's embedded into the notification mechanism.
As per wear-user experience, it should be there to grant the user a grade of control on the applications those try to push content to the Context Stream. Imagine a scenario where an application continues to spam the stream; the user would definitely appreciate the possibility to prevent it.

Android: Is it possible to add functionality to the call screen?

Is it possible to customize the call screen in Android? Example would be, two users have the same application, user calls, but the other user cannot pick up, so they respond with some type of predetermined image baked into the application.
Is this possible?
Does this break any rules?
The built-in Phone application is open source, so you can clone it and modify it to your own needs. This will let you make/receive calls using your custom UI (I believe you can receive. It looks like there's ACTION_ANSWER that you can listen to and handle). Of course, the user will be prompted on what application to use for theses actions and you'll have to convince your users that they should use your app instead of the built-in one.

Categories

Resources