How to Integrate Push Notifications in HarmonyOS: A Step‑by‑Step Guide
This tutorial walks you through the complete process of adding push notification support to a HarmonyOS app, covering environment setup, certificate generation, profile configuration, client ID setup, permission requests, token retrieval, handling cold and hot starts, and the required server payload format.
Sohu News, as a HarmonyOS partner, launched its app in the HarmonyOS Single-Framework Market in December 2023 and now includes push notifications as part of its Phase‑2 feature development.
Development Environment
IDE: DevEco Studio NEXT Developer Beta2 (Build 5.0.3.502, July 28 2024)
SDK: HarmonyOS NEXT Developer Beta2 SDK based on OpenHarmony Ohos_sdk_public 5.0.0.22 (API Version 12 Canary3).
1. Generate Signing Certificate
In the main menu select Build > Generate Key and CSR . First create a P12 certificate, then a CSR certificate (the opposite order of iOS).
Key Store File: set the storage path and P12 file name. Alias: identifier for the key (remember it for later signing). Validity: default 25 years. Certificate: fill organization, city, country code, etc.
After generating the CSR, the results look like the following:
Sohu Smart Platform Tech Team
The Sohu News app's technical sharing hub, offering deep tech analyses, the latest industry news, and fun developer anecdotes. Follow us to discover the team's daily joys.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
