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.
Related
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
I have a live streaming app where you can be recording for hours and when the user receives a text message or a phone call, the vibration is trnaslated into sound and rippling video on the streaming.
Is it possible to somehow programmatically disable all notifications or do I have to ask the user to do so by himself?
You cannot control notifications from other apps. There is indeed a solution for rooted devices.
'Standards' part in this guide says:
One of the unfortunate problems Android users face is that there is no
centralized control for how notifications work. This means that if
there is an application prompting you with a notification, short of
uninstalling the application, there isn’t much you can do. Starting in
Android 4.1, users received a buried binary setting to 'Turn off
notifications’ for a specific app.
No, unfortunately not. Perhaps on rooted devices, but ¯_(ツ)_/¯. Best way seems to navigate the user to the related setting to disable all notifications, as you have also mentioned.
If an app is in the background, and the user receives the push, and the user taps on the notification, thus making the app active, how do I detect in PubNub whether the app was brought from the background as in this case? Help is much appreciated! Thanks!
Android & iOS have delegates/events that handle this and at that point, you could manually do whatever is necessary. However, PubNub's SDKs reconnect and retrieve missed messages automatically. Android requires some extra code but pretty trivial. There are is some level of customization that you can do when you initialize PubNub in the app.
See the Android SDK docs and iOS SDK docs for more details and contact support#pubnub.com, if needed.
I'm making an app that will work with Android Wear,
And I wanted to implement a command into Google's "Ok Google" option.
I saw this page:
http://developer.android.com/training/wearables/apps/voice.html
But it's related only to apps that include Activities in the Android Wear.
I wanted to ask:
Can I add custom commands? I mean, those who does not start with the word "Start"?
Can I add commands that will do another thing than just opening the app? Like running a method?
If it's not the place to ask this, can you give me an email/link to Google Developers help/support? thanks.
For apps that run on the Android Wear Device:
No, the list of system-provided voice actions is fixed (and listed here). You can set your application to be able to respond to them (for example, to take a note), but you cannot add new ones.
Yes. When already inside your app, you you can use startActivityForResult() using the ACTION_RECOGNIZE_SPEECH to get voice input. You could then use the returned string to execute whatever you want.
Meanwhile, if you're just displaying notifications from an Android app running in a handheld, then you cannot presently have voice actions at all (at least in a literal sense). What you may have, though, is a notification action that requests voice input. That input will then be passed as an extra in the Intent that is delivered to the app in the handheld.
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.