/** * @desc 推送消息到应用 */ public static function pushAppMsg($uid, $pushMsg) { //暂时不用这个推送 return; $device = new InstallationModel(); $msg = $device->findByUid($uid); if (isset($msg[0]) && !empty($msg[0])) { $deviceMsg = $msg[0]; $push = new PushMsgModel(); if (isset($deviceMsg->deviceToken) && isset($deviceMsg->deviceType) && $deviceMsg->deviceType == 'ios') { $push->createIosPush($deviceMsg->deviceToken, $pushMsg); } elseif (isset($deviceMsg->installationId) && isset($deviceMsg->deviceType) && $deviceMsg->deviceType == 'android') { $push->createAndroidPush($deviceMsg->installationId, $pushMsg); } } }
public function actionPushMsg() { $device = new InstallationModel(); $msg = $device->findByUid('18666486846'); // var_dump($msg); $deviceMsg = $msg[0]; $push = new PushMsgModel(); if (isset($deviceMsg->deviceType) && $deviceMsg->deviceType == 'ios') { $push->createIosPush($deviceMsg->deviceToken); } }