1. Download the PHP SDK HTTP://DOCS.JPUSH.IO/SERVER/PHP_SDK/2 to the Aurora push website. Unzip vendor.tar.gz to your project, thinkphp/library/vendor/under 3. Create a PHP code for the Jpushcontroller file under the Home module controller of the app folder: ‘; $client = new Jpushclient (' 64237c873a665c79b1ece96c ', ' 41aeddfab4828ddb64a5a1f1 '); try {$result = $client->push ()->setplatform (M\all)->setaudience (m\all)->setnotification (m\ Notification (' Hi, Jpush ', m\android (' Hi, Android ', ' Message Title ', 1,array ("Key1" = "value1", "key2" = "value2", "Key3" = "Value3")))->setmessage (' Message Content ', ' Message Title1 ', ' message Type ', Array ("Key1" = > "value1", "key2" = "value2", "Key3" and "Value3"))->send (); Echo ' Push Success. $BR; Echo ' Sendno: '. $result->sendno. $BR; Echo ' msg_id: '. $result->msg_id. $BR; Echo ' Response JSON: '. $result->json. $BR; } catch (Apirequestexception $e) {echo ' Push Fail '. $br; Echo ' Http Code: '. $e->httpcode. $br; Echo ' Code: '. $e->code. $BR; echo ' message: '. $e->message. $BR; Echo ' Response JSON: '. $e->json. $BR; Echo ' Ratelimitlimit: '. $e->ratelimitlimit. $BR; Echo ' ratelimitremaining: '. $e->ratelimitremaininG. $BR; Echo ' Ratelimitreset: '. $e->ratelimitreset. $BR; } catch (Apiconnectionexception $e) {echo ' Push Fail '. $br; Echo ' message '. $e->getmessage (). $br;} }
Aurora Push Development-thinkphp Integration