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)