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