Clime
← Back to Blog
Tutorials

Implementing Weather Notification Deep Links on Wear OS: A Step-by-Step Guide

June 17, 2026 · The Clime Team
Implementing Weather Notification Deep Links on Wear OS: A Step-by-Step Guide

Integrating deep links into weather notifications on Wear OS devices can significantly enhance user engagement by providing direct access to specific weather information. This guide outlines the steps to implement deep links in your weather notifications.

Understanding Deep Links in Wear OS

Deep links are URLs that direct users to a specific location within an app. In the context of Wear OS, deep links can be used to navigate users directly to detailed weather forecasts, radar images, or other relevant information within your weather application.

Prerequisites

Before proceeding, ensure that:

  • Your Wear OS application is set up to handle deep links.
  • You have a basic understanding of Android development and Wear OS app architecture.

Step 1: Define the Deep Link URL Scheme

Decide on a custom URL scheme for your app, such as weatherapp://forecast/. This scheme will be used to identify and handle deep links within your application.

Step 2: Configure the AndroidManifest.xml

In your AndroidManifest.xml, declare an intent filter for the activity that should handle the deep link:

<activity android:name=".WeatherDetailActivity">
 <intent-filter>
 <action android:name="android.intent.action.VIEW" />
 <category android:name="android.intent.category.DEFAULT" />
 <category android:name="android.intent.category.BROWSABLE" />
 <data android:scheme="weatherapp" android:host="forecast" />
 </intent-filter>
</activity>

This configuration ensures that any deep link matching the scheme weatherapp://forecast/ is routed to WeatherDetailActivity.

Step 3: Handle the Deep Link in Your Activity

In the onCreate method of WeatherDetailActivity, retrieve the data from the deep link:

@Override
protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_weather_detail);

 Uri data = getIntent.getData;
 if (data != null) {
 String forecastId = data.getLastPathSegment;
 // Use forecastId to load the specific weather details
 }
}

This code extracts the forecast ID from the deep link and uses it to load the corresponding weather details.

Step 4: Create and Send Notifications with Deep Links

When creating a weather notification, include the deep link in the PendingIntent:

Uri deepLinkUri = Uri.parse("weatherapp://forecast/" + forecastId);
Intent deepLinkIntent = new Intent(Intent.ACTION_VIEW, deepLinkUri);
PendingIntent deepLinkPendingIntent = PendingIntent.getActivity(context, 0, deepLinkIntent, PendingIntent.FLAG_UPDATE_CURRENT);

Notification notification = new NotificationCompat.Builder(context, CHANNEL_ID)
 .setContentTitle("Weather Update")
 .setContentText("Tap for detailed forecast")
 .setSmallIcon(R.drawable.ic_weather)
 .setContentIntent(deepLinkPendingIntent)
 .build;

NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
notificationManager.notify(notificationId, notification);

This setup ensures that tapping the notification opens the specific weather details associated with the forecastId.

Step 5: Test the Implementation

Deploy your application to a Wear OS device or emulator and verify that tapping the notification correctly navigates to the intended weather details.

Best Practices

  • User Experience: Ensure that the deep link provides value to the user by directing them to relevant and timely weather information.
  • Error Handling: Implement error handling to manage scenarios where the deep link might be invalid or the content is unavailable.
  • Compatibility: Test the deep link functionality across different Wear OS devices to ensure consistent behavior.

By following these steps, you can enhance user engagement by providing direct access to specific weather information through deep links in your Wear OS notifications.

For more detailed information on handling notifications in Wear OS, refer to the Android Developers Guide on Notifications.

Frequently Asked Questions