App message push (Aurora push)

Source: Internet
Author: User

App message push, use of third party platform is Aurora push

Simple case (take thinkphp as an example):

1, download Download phpsdk

2, the PHPSDK directory under the Jpush-api-php-client-3.5.1\src\jpush,jpush all the files copied to the project: Thinkphp\library\org\jpush

3, thinkphp in the following file will be automatically loaded

$client=New\org\push\client ($app _key,$master _secret); $push=$client-push (); $push->setplatform (Array(' iOS ', ' Android ')); //push to each user based on the device ID. $registrationid _arr is an array of up to 1000 pushes at a time.             $push->addregistrationid ($registrationid _arr); //False:ios push for the development environment            $push->options (Array(                ' Apns_production ' =false,//indicates the duration of offline message retention (seconds), which is saved by default for 1 days//' time_to_live ' =>86400,            )); $push->setnotificationalert (' You have a new matching order, please quote ASAP! ‘); $push->send ();

4, according to Registrationid (registration ID, or called Device ID) push, you need to save the device ID to the database. That is, you need to write an interface, to the user login success, request this interface, the app is currently logged in (last login) user's device ID and user ID, binding to the user table.

When you want to push the message to this user, according to the user ID to find the user's corresponding device ID, push can be.

Reference:

Aurora Documentation:

(Push API v3) http://community.apicloud.com/bbs/forum.php?mod=viewthread&tid=2420&page=1#pid21227

Https://github.com/jpush/jpush-api-php-client/blob/master/doc/api.md#sms-message

Aurora Console: Https://www.jiguang.cn/app/list

Other:

http://www.dodobook.net/php/780

Http://www.111cn.net/phper/thinkPhp/112810.htm

Http://www.bubuko.com/infodetail-589128.html

   

App message push (Aurora push)

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.