[Apicloud Tutorial] Aurora push (Ajpush) demo

Source: Internet
Author: User

Note: Use Aurora Push , you must compile the official version on the official website and tick the Aurora push module. Apploader The Aurora Push module is not currently included in the Apploader used directly in the application, usually reported similar to: cannot call method ' init ' of Undefind atxxx.html the error.


The official version of the Aurora push module is a simple code example for each API.

Please change the Appkey in config to your app before use.

Steps to use:

1. Create a new app in Apicloud Cloud and get the app package name: Preview-"End development-" certificate-"get the appropriate package name (ID) for iOS and Android.

2. Log in the Aurora to push the official websitehttp://www.jpush.cn, register as a developer, then go to the console, create a new app, fill in the corresponding location with the app package name obtained on the Apicloud website, complete it, get it to Appkey on the "app info" screen, copy the Appkey, and write to the app_ in the config file in this demo. Key field

3. Submit the code to the new app in 1, compile, install, use

4, log on to the aurora to push the official website, enter the console, select 2 new application, start sending messages/notifications and so on.


Note: The Monitor status bar notifies the clicked function to write as far as possible on the index page:
Index.html:

var jpush = null;
Apiready = function () {
Jpush = Api.require (' Ajpush ');
Api.addeventlistener ({name: ' appintent '},function (ret,err) {
Alert (' Notifications are clicked, receive data: \ n ' + json.stringify (ret) ');//listen for data received after a notification is clicked
})
Api.addeventlistener ({name: ' pause '}, function (Ret,err) {
OnPause ();//monitor app goes backstage, notifies Jpush to pause event
})

Api.addeventlistener ({name: ' Resume '},function (ret,err) {
Onresume ();//monitor app revert to foreground, notify Jpush recovery Event
}) 
}

Statistical-app Recovery
function Onresume () {
Jpush.onresume ();
Console.log (' Jpush onresume ');
}

Statistics-app suspended
function OnPause () {
Jpush.onpause ();
Console.log (' Jpush onPause ');
}

Original link : http://community.apicloud.com/bbs/forum.php?mod=viewthread&tid=1841

[Apicloud Tutorial] Aurora push (Ajpush) demo

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.