{"id":18896594,"url":"https://github.com/buptlsp/yii2-jpush","last_synced_at":"2025-04-15T01:52:53.988Z","repository":{"id":62519458,"uuid":"54968179","full_name":"buptlsp/yii2-jpush","owner":"buptlsp","description":"极光推送的yii2封装","archived":false,"fork":false,"pushed_at":"2016-04-01T07:04:41.000Z","size":6,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T01:52:49.371Z","etag":null,"topics":["jpush","yii","yii2"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/buptlsp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-29T10:48:34.000Z","updated_at":"2019-05-10T03:54:44.000Z","dependencies_parsed_at":"2022-11-02T13:18:19.649Z","dependency_job_id":null,"html_url":"https://github.com/buptlsp/yii2-jpush","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buptlsp%2Fyii2-jpush","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buptlsp%2Fyii2-jpush/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buptlsp%2Fyii2-jpush/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buptlsp%2Fyii2-jpush/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buptlsp","download_url":"https://codeload.github.com/buptlsp/yii2-jpush/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248991540,"owners_count":21194894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jpush","yii","yii2"],"created_at":"2024-11-08T08:34:35.162Z","updated_at":"2025-04-15T01:52:53.968Z","avatar_url":"https://github.com/buptlsp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"JPUSH Encapsulation for Yii 2\n========================\n\n这个扩展提供了一个基于yii2的极光推送封装。\n\n本代码仅是对极光推送做了一层yii2的封装，并不会修改到其中的源码，具体的许可可以参照[极光推送](http://docs.jpush.cn/display/dev/Push-API-v3)。\n\nInstallation\n------------\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).  \n推荐的方式是通过composer 进行下载安装[composer](http://getcomposer.org/download/)。  \n\nEither run  \n在命令行执行  \n```\nphp composer.phar require --prefer-dist \"lspbupt/yii2-jpush\" \"*\"\n```\n\nor add  \n或加入  \n\n```\n\"lspbupt/yii2-jpush\": \"*\"\n```\n\nto the require-dev section of your `composer.json` file.  \n到你的`composer.json`文件中的require-dev段。  \n\nUsage\n-----\n一旦你安装了这个插件，你就可以直接在配置文件中加入如下的代码：  \n\n```php\nreturn [\n    'components' =\u003e [\n        'jpush' =\u003e [\n            'class' =\u003e 'lspbupt\\push\\Jpush',\n            'app_key' =\u003e \"\", //极光推送的appkey\n            'app_secret' =\u003e \"\", //极光推送的appsecret\n        ],\n    ],   \n    // .... \n];\n```\n\n在配置好之后，你完全可以像之前使用jpush一样使用所有的方法 \n```php\n$result = Yii::$app-\u003ejpush-\u003epush()\n    -\u003esetPlatform('all')\n    -\u003eaddAllAudience()\n    -\u003esetNotificationAlert('Hi, JPush')\n    -\u003esend();\n```\n具体的函数的方法可以访问[极光推送](http://docs.jpush.io/server/php_sdk/#composer)  \n\n另外，也可以按传统的方式使用该插件\n\n```php\n$client = new \\lspbupt\\push\\Jpush([\n    'app_key' =\u003e $app_key,\n    'app_secret' =\u003e $app_secret,\n]);\n$result = $client-\u003epush()\n    -\u003esetPlatform('all')\n    -\u003eaddAllAudience()\n    -\u003esetNotificationAlert('Hi, JPush')\n    -\u003esend();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuptlsp%2Fyii2-jpush","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuptlsp%2Fyii2-jpush","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuptlsp%2Fyii2-jpush/lists"}