SecretKeyof a TPNS application?
Please download the official Huawei HMS SDK and copy all files and subdirectories in the
assets directory to that in your application project. If the
assets directory does not exist in the application project, create one.
TPNS does not support Nubia phones released after 2015, as the new version of Nubia operating system has a super power-saving feature, which will kill background processes very quickly and prevent TPNS Service from being started, resulting in failures of registration with Nubia phones.
bundle idconfigured in the Xcode project matches the configured
Provision Profilefile and whether the
Provision Profilefile corresponding to the application has been configured with the message push capability.
aps-environmentfield in the
embedded.mobileprovisionfile is correct.
The production environment must meet the following testing conditions: the application is a build packaged with the ad-hoc certificate or the release certificate ("Production") and uploaded to App Store.
unregisterNotificationAPI, register the notification again and clear device data and settings.)
According to the documentation at Mi official website, the notification bar only displays one push message by default. If you want multiple messages to be displayed in the notification bar, you need to set a unique
notify_id for different messages (a new notification bar message with the same
notify_id will override the previous one). The parameter at TPNS official website is
There is no limit on the number of notification bar messages that a phone can receive and display. The reasons for not displaying may include:
n_idfor different messages.
rawdirectory, which does not need the extension, such as
xg_ring. For iOS, select the ringtone file in the
bundledirectory, which requires the extension, such as
ring=1in the push message body, and set
ring_rawto the name of the specified ringtone file without the extension in the
rawdirectory of the Android project. For iOS, set the sound in the push message body to the name of the specified ringtone file with the extension in the
bundledirectory of the project.
If the client has integrated with a vendor channel, due to the limitations of Huawei and Meizu, a custom ringtone file is not allowed on their phones, and the system sound will be used by default. Currently, a custom ringtone can be used on Mi phones.
target sdkis greater than or equal to 21, causing the icon to be gray.
target sdkto below 21. If you don't want the
target sdkto be below 21, you can rename a small transparent background .png image to
notification_icon.png(the filename must be unique) and place it in
drawable; in this way, the small icon will be displayed as gray (but shaped).
- The small icon must be a PNG image with the alpha transparency channel.
- The background must be transparent.
- The image must be in white. Do not upload an image in another color.
- Do not leave too much padding around the icon.
- We recommend you use an image with dimensions of 46x46, as smaller images will be blurry, while larger images will be automatically scaled down.
If the number of loaded methods in the project exceeds 65K, please create subpackages for the project.
Log in to the TPNS Console and select Created via API on the Push Management > Task List page to view the records of pushes created through API.
The currently bound device (B) can receive the push, but the original bound device (A) cannot, as only the last device bound to the account can receive pushes.
Activitypage but it often cannot be redirected to normally?
On some phones, redirection upon click on the notification bar may experience permission issues.
android:exported="true" to the
Activity to be opened.
The messages are in ascending order by message ID. The client will also receive messages in this rule; therefore, the order in which the messages are received is the same as that in which they are sent.
Yes. If a past time is selected, the system will send the push immediately.
The registration method can be called anywhere, but
ApplicationContext needs to be passed.