AccessID
, AccessKey
, and SecretKey
of 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 id
configured in the Xcode project matches the configured Provision Profile
file and whether the Provision Profile
file corresponding to the application has been configured with the message push capability.aps-environment
field in the embedded.mobileprovision
file 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.
unregisterNotification
API, 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 n_id
.
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_id
for different messages.raw
directory, which does not need the extension, such as xg_ring
. For iOS, select the ringtone file in the bundle
directory, which requires the extension, such as xg_ring.wav
).ring=1
in the push message body, and set ring_raw
to the name of the specified ringtone file without the extension in the raw
directory 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 bundle
directory of the project.Note:
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 sdk
is greater than or equal to 21, causing the icon to be gray.target sdk
to below 21. If you don't want the target sdk
to 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).Note:
- 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.
Activity
page but it often cannot be redirected to normally?On some phones, redirection upon click on the notification bar may experience permission issues.
Solution: in androidManifest.xml
, add 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.
Was this page helpful?