In the first week of 11 weeks of Android, it has lots of new features that are included new notifications & new sign-in feature as well. This article is focused on the new conversation notification feature that is available in the upcoming Android OS version 11.
Stay in touch with your loved once with the new conversation notification feature. Show conversation with people with the use of a bubble (Eg. Facebook messenger). The goal of this new feature is to The People in your life feel like they’re right there with you. With the use of conversation, you’ll be able to start a new conversation through the pinnable shortcut that is available in the conversation section in the notification pan.
Check updates of conversation which will now appear above notification in notification pan. Also, you can switch to any conversation you had with your loved once without switching through the other apps with the use of a bubble.
Now we will see how to build a conversation shortcuts.
- First, you need to publish a shortcut and set it as longlived so it can be used across OS features.
- Shortcuts are a combination of metadata and properties.
- Publish regular shortcuts with essential details like icon, name & intent, hence these details are optional, it is not mandatory to add these details.
- Set longlived as true so the Operating System knows to keep track of that conversation.
- To build a conversation there is a recommendation from the android team at google that you need to define the contact or contact details that are related to the conversation. This is for the Operating System to give more context about that particular conversation that helps in ranking the sharing suggestions.
- First, build a person object with details about the contact.
- Then, create a shortcut referencing your person object and set as longlived.
- The operating system can handle only limited publish limit at a time,pushDynamicShortcut()this method automatically handles the shortcut publish limit.
- Shortcuts that are set as longlived are stored in the system cache.
- Developers are also can remove cached conversations programmatically with the use ofremovelongLivedShortcuts().
- But cache shortcuts can only be removed if the user has no longer access to that conversation.
Awesome things can be done with the conversation shortcuts
- Aside from being pinned on the launcher, conversations are also meant to appear in the notification bar above the notifications.
- Conversation notifications make it easier to see the sender’s avatar, name, and message.
- Conversations are also prioritized on the sharing menu.
- Conversations have more advanced enhanced features, such as users can long press on the conversation notification to set it as a priority.
- Priority conversations providing a quick setting to make it more important conversation visible and easy to get access to that conversation.
- Priority conversations have appeared at the top of the conversation section.
- As well as sender’s avatar is always on display, lock screen & status bar when you get an update of that conversation.
- Priority conversations are also breakthroughDo Not Disturb (If set) mode of your device.
- It is very easy to set conversation shortcuts in messaging style as you’ve done hard-work previously (while building conversations).
- To add shortcuts to notifications set theshortcutIDfrom the conversation shortcut object that is defined in the previous code snippet.
- Use the previous person object when constructing message style notifications.
- OK, that’s it, once you publish this notification this will appear in the conversation section in notification pane (bar).
- Many other existing apps in which the chatting functionality is there are published messaging-style notifications will still appear in the conversation section until these apps target Android 11.
- Drawback-: Users won’t be able to make this conversation bubble type for multi-tasking & they won’t be able to mark these conversations as a priority.
- Bubbles allow users to chat multitasking without switching between the app.
- Bubbles are float over what you’re doing on your phone when you click on it.
- Tapping on the bubble you can see floating conversation window will appear from that window you can read and respond to chat.
- Users can also select the conversation bubble right from the notification (In the notification, one button is there to open the conversation bubble).
- Users can also go back from the chat to what they’re doing previously by collapsing outside the bubble.
- Bubbles make it very easy to get back to chat without switching apps.
- Developers can reuse the conversation intent to create bubble metadata.
- Bubble constructed using adding the metadata of the bubble to the notifications.
- It’s up to developers that if they’re using the same intent or reuse the intent from conversation shortcut.
- Users can create bubbles in two ways:
- Bubble for the specific chat. (By tapping bubble button on notification)
- Bubble for all chat. (Requires users to adjust app bubble setting)
- When users create the bubble for specific notification, it means that it is important and they want quickly and easily accessible.