Hbuilder Development app uses push-to-send messages

Source: Internet
Author: User

1. App-side configuration

A. Allow use of third-party plugins:


Open the app's Manifest.json file, switch to a visual view, and allow the use of third-party plugins.

B, configure the third-party plug-in (a push)

Add a push node under the permission node in the app's Manifest.json file:

"Push": {"description": "Manage push message plug-in"},

If it already exists, do not change it.

To add a push node under the Plus-->distribute-->plugins node

"Push": {"description": "Manage message push capability", "Cover": "false", "Igexin": {"AppID": "", "Appkey": "", "Appsecret": ""}},
The above AppID, Appkey, and Appsecret are all added after the app has been registered on a Twitter site.

C. Bind events that receive push messages

Document.addeventlistener ("Plusready", function () {    message = document.getElementById ("message");    Listen for click Message Event    plus.push.addEventListener ("click", Function (msg) {/* * * * * * * *       as required           ), false);    Listen for online message event    Plus.push.addEventListener ("Receive", Function (msg) {/     * * * * * as required * *    }, False);}, False);

2, a push website registration

Follow the prompts to register and add the app, and then, as shown below, click on the app configuration to view AppID, Appkey, etc., and enter it in the app profile location. When the app is opened online, if the number of users on the page is displayed as 1, the communication between the push and app is successful.


Click Create push to push messages for the app.

Note: The app needs to be packaged and then installed on the phone, otherwise the app's AppID parameters are not parameters configured in the configuration file, but hbuilder the parameters of the real Machine debug base, which will result in a push-to-app connection unsuccessful.





Hbuilder Development app uses push-to-send messages

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.