Search code examples
androidnotificationswear-os

Disable default notifications android wear


I have an Android Wear App with a WearableListenerService that shows a custom notification when it receives a DataMap. I have an app on my phone that sends the DataMap to wearable app. This app receives notifications from Firebase and the wearable shows them too. I want only Wearable to show my custom notifications not the phone from where it's initiated.

Can anyone help me out?

Thank you. Kind Regards.


Solution

  • From the official documentation:

    By default, notifications are bridged (shared) from an app on a companion phone to the paired watch. If you build a standalone watch app and you have a companion phone app, the apps may duplicate notifications. The Android Wear includes features to handle this problem of duplicate notifications.

    You need to add the following to your app's manifest file:

    <application>
    
        <meta-data
            android:name="com.google.android.wearable.notificationBridgeMode"
            android:value="NO_BRIDGING" />
    
    </application>
    

    Or you can do it in code. See the documentation for more details.