# Message Push Usage Guide
# I. Notice Before Use
Special note
- Tencent Cloud Mobile Push TPNS Has stopped selling,View the announcementOnly support free trial,View Details "。
- If you need to access other third-party push messaging services, you can refer to the way community developers share access,Go to View
App Message push is a way to unify the management of App A service for users to push messages, this message push feature is based onTencent Cloud Mobile PushService realization, developers need to go to Tencent Cloud to useMobile pushServices, and create the corresponding products, applications, and configuration before use. To help developers better understand the overall logic, read this section carefully:
- First, go to Tencent Cloud to use a mobile push service to createProducts and Applications Pushed by Tencent Cloud MobileOf the products and applications and complete the relevant configuration to obtain the corresponding profile and AccessID、AccessKey Such information
- Then, configure Enable Push Messaging in Developer Tools, and fill in the corresponding configuration file and AccessID、AccessKey Such informationNote: After the developer tools open the ability to push messages, the developer tools will automatically access the corresponding SDK
- And then, in JS The code side uses the interface to start the messaging service
- Finally, go back to the Tencent Cloud Console to create push tasks, or use the server API Go to Push, App End can receive the corresponding messageIn addition, the management functions of the push messaging service are also operated in the Tencent Cloud Console.
- This service is a paid service of Tencent Cloud. You can clickAt the Price
- In order to facilitate developers to develop and experience this feature, Tencent Cloud also providesFree trial quota
# 1. About Compliance Guidelines
According to regulatory requirements, the use of SDK The end user must be notified in the Privacy Policy SDK Use purposes, and shall not initialize any of the End Users without their consent to the Privacy Policy SDK。 Please ensure that the app you develop or operate has a Privacy Policy text that complies with regulatory requirements. It is also important that you clearly inform end users that your app uses mobile push services.
# 2. Feedback on issues
- If it is jsapi Of the problem may be contactedLittle helperEnter the official technical exchange group for processing
- If you encounter the function of push message or related problems, you can contact the mobile push assistant in the developer tools to help solve the push message, or go toTencent Cloud Mention Work OrderFor processing
# II. Operational Guidelines
This section of the operation guide only contains the developer tools on the operation, Tencent Cloud Console related operations can go toTencent Cloud Mobile PushSee
# 1、Android Message Push
# a) Download Profile
- Go toMobile Push Console, EnterApp Push management - Basic configuration, Click to download "Profile"
Other considerations
1, such as developers in the Tencent cloud push console update the relevant configuration, developers also need to update the developer tools here to the latest configuration file
# b) modify SDK version
- Download version number 1.06.2306282 ofDeveloper Tools, after entering the multiterminal mode, click
project.miniapp.json
- will Android SDK The version should read 1.0.4 And above version
# c) Enable message push and configure tpns-configs.json
- in
project.miniapp.json
ofextend SDKConfigure to enable message push and tpns-configs.json , the operation is as follows
<img src="https://testchu-7gy8occc8dcc14c3-1304825656.tcloudbaseapp.com/img%2Fmelody%2F%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_6450b0da-c66c-41e7-9460-87b66110880f.png />
# d) Go to Tencent Cloud to launch a message
- Details can be viewedCreate a push task
# 2、iOS Message Push
# a) Get a push certificate
- You need to register in the mobile push service according to the Tencent cloud document guidelines iOS Push the certificate, details can be viewedPush Certificate Access Guidelines
- While following the documentation above, create one more new Bundle Id Used forNotification Service ExtensionCapabilities (i.e., Apple's Notification Service Extendsion)
- In addition, it is necessary to follow up on the developer tools.
project.miniapp.json
Setting in ServiceBundleId, and the selection of the new certificate The certificate must be used in conjunction with App The consistency. - And, developers need to download and save Bundle Id Corresponding Profile (Run with the development version, build with the official version)It needs to be used in developer tools.
Be careful
- The main project's Bundle Id and Service of Bundle Id It must be different, and Service of Bundle Id Must be completed with the main project's Bundle Id For the prefix (e.g., the main project's Bundle Id:com.tencent.tpns,Service of Bundle Id:com.tencent.tpns.service)。
- certificate Must and App The consistency of
# b) Enable messaging and configure relevant information
- in
project.miniapp.json
ofextend SDKTo enable message push and configure AccessID、AccessKey as well as serviceBundleId
- After the configuration is successful, you can start running/to construct IPA, requiredCertificate signatureIn a manner that cannot be usedProvisional signatureThe way
- When push messaging is enabled, signing prompts for additional Notification Service Extension of Profile For signature, and this Profile Is in the steps a) Saved in the Profile
Windows: When signing, in the NSE Profile Select the corresponding profile
Mac: The following selection box appears when you use the message push
# III. API list
After the above configuration is complete, you need to call the following JSAPI Use the Message Push feature:
# IV. OTHER NOTES
iOS Vendor channel access is supportedAndroid Vendor channel access is also supported, covering channels including:Huawei、glory、millet、Meizu、VIVO、OPPOAttention, you have to choose. 1.0.4 Or above version
Note:Android of targetVersion Recommended setting for 33 。
In addition, if using Huawei's channel, please refer to the following to configure the version of Huawei's dependency package
# V. How to Turn Off Using Messaging SDK
- If the developer no longer uses the message push SDK , available at
project.miniapp.json
ofextend SDKIn ConfigurationDo not tickEnable message push SDK can then - Once the configuration is complete, rebuild the new installation package
# VI. Frequently Asked Questions
# 1. XGPush_registerPush:fail
- The ability to push messages does not support debugging in Mobile App Assistant, developers need to build APK Install to the phone for testing
# 2. TpnsPlugin ERROR
- If configured tpns-configs.json The following error still appears, developers need to check the package name configured on the Tencent Cloud Mobile Push Console and build in Weixin DevTools. APK Is the package name consistent with the
# 3. Push failure
If self-test found push failure, you can go to Tencent Cloud Console to use the relevant investigation tools for investigationIf there are still problems after self-examination, please contact Tencent cloud customer service.