{"id":36969391,"url":"https://github.com/cncal/getui","last_synced_at":"2026-01-13T21:07:58.853Z","repository":{"id":56954535,"uuid":"95945138","full_name":"cncal/getui","owner":"cncal","description":"Getui sdk package for laravel.","archived":true,"fork":false,"pushed_at":"2020-09-21T09:51:11.000Z","size":178,"stargazers_count":18,"open_issues_count":2,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-20T22:47:16.506Z","etag":null,"topics":["getui","getui-sdk","laravel","laravel-package","queue"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cncal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-01T05:53:13.000Z","updated_at":"2023-08-23T01:55:39.000Z","dependencies_parsed_at":"2022-08-21T08:50:23.745Z","dependency_job_id":null,"html_url":"https://github.com/cncal/getui","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/cncal/getui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cncal%2Fgetui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cncal%2Fgetui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cncal%2Fgetui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cncal%2Fgetui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cncal","download_url":"https://codeload.github.com/cncal/getui/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cncal%2Fgetui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28400785,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["getui","getui-sdk","laravel","laravel-package","queue"],"created_at":"2026-01-13T21:07:58.130Z","updated_at":"2026-01-13T21:07:58.847Z","avatar_url":"https://github.com/cncal.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Getui sdk package for laravel\n\n\u003cp align=\"left\"\u003e\n\u003ca href=\"https://packagist.org/packages/cncal/getui\"\u003e\u003cimg src=\"https://poser.pugx.org/cncal/getui/v/stable.svg\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/cncal/getui\"\u003e\u003cimg src=\"https://poser.pugx.org/cncal/getui/d/total.svg\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/cncal/getui\"\u003e\u003cimg src=\"https://poser.pugx.org/cncal/getui/license.svg\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## 依赖\n* Laravel 5+. （如果使用队列，须 Laravel 5.5 以上）\n* cUrl\n\n## 安装\n* 执行命令： \n```sh\n$ composer require cncal/getui\n```\n\n* 如果 Laravel 版本小于5.5：\n    * 添加 `GetuiServiceProvider` 至 `config/app` 的 `providers`：\n    ```php\n    Cncal\\Getui\\GetuiServiceProvider::class,\n    ```\n\n    * 添加 Facade 至 `config/app` 的 `aliases`：\n    ```php\n    'Getui' =\u003e Cncal\\Getui\\Facades\\Getui::class,\n    ```\n\n* 发布配置文件 `config/getui.php`：\n```php\n$ php artisan vendor:publish --provider=\"Cncal\\Getui\\GetuiServiceProvider\"\n```\n\n## 配置\n在 `config/getui.php` 中配置推送信息：\n```php\n// 个推基础信息，在平台新建应用的时候生成\n'basic' =\u003e [\n    'host' =\u003e \"http://sdk.open.api.igexin.com/apiex.htm\",\n    'app_id' =\u003e \"\",\n    'app_key' =\u003e \"\",\n    'master_secret' =\u003e \"\",\n],\n\n// 推送消息的基础设置\n'push' =\u003e [\n    'is_ring' =\u003e true,  //是否响铃\n    'is_vibrate' =\u003e true,  // 是否振动\n    'is_clearable' =\u003e true,  // 是否可清除\n    'is_offline' =\u003e true,  // 是否发送离线消息\n    'offline_expire_time' =\u003e 2, // 离线消息过期时间，单位为小时（范围：0- 72），该时间段内 cid 在线过的用户均可收到通知\n    'network_type' =\u003e 0,  // 是否根据网络环境推送消息，0为不限制推送，1为wifi推送，2为4G/3G/2G\n],\n\n// 队列配置\n'queue' =\u003e [\n    'is_used' =\u003e false, // 是否使用队列\n    'connection' =\u003e env('QUEUE_DRIVER', 'sync'), // 连接\n    'queue' =\u003e 'default', // 队列\n],\n```\n\n## 使用\n* 函数：\n```php\n\u003c?php \nuse Getui;\n\n/**\n * 推送通知至指定用户\n *\n * @param $data\n *\n * @return $rep\n */\nGetui::pushMessageToSingle($data);\n\n/**\n * 推送通知至指定用户列表\n *\n * @param $data\n *\n * @return $rep\n */\nGetui::pushMessageToList($data);\n\n/**\n * 推送通知至该应用的所有用户\n *\n * @param $data\n *\n * @return $rep\n */\nGetui::pushMessageToApp($data);\n\n```\n\n* 入参 `$data`\n    * [点击通知打开应用模板](http://docs.getui.com/server/php/template/#1)\n    ``` php\n    $data = [\n        'template_type' =\u003e 1,\n        'template_data' =\u003e [\n            'title' =\u003e '', // 通知标题，string(40), 必填\n            'text'  =\u003e '', // 通知内容，string(600), 必填\n            'logo'  =\u003e '', // 通知图标名称，string(40), 必填\n            'logo_url'  =\u003e '', // 通知图标url地址，string(100), 必填\n            'transmission_type'    =\u003e 2, // 是否立即启动应用：1 立即启动 2 等待客户端自启动，必填\n            'transmission_content' =\u003e '', // 透传内容，不支持转义字符，string(2048), 必填\n        ]\n        'cid' =\u003e 'target cid', // 推送通知至指定用户时填写\n        'cid_list' =\u003e ['cid1','cid2',...], // 推送通知至指定用户列表时填写\n    ];\n    ```\n    * [点击通知打开网页模板](http://docs.getui.com/server/php/template/#2)\n        ``` php\n        $data = [\n            'template_type' =\u003e 2,\n            'template_data' =\u003e [\n                'title' =\u003e '', // 通知标题，string(40), 必填\n                'text'  =\u003e '', // 通知内容，string(600), 必填\n                'url'   =\u003e '', // 点击通知后打开的网页地址，string(200), 必填\n                'logo'  =\u003e '', // 通知图标名称，string(40), 必填\n                'logo_url'  =\u003e '', // 通知图标url地址，string(100), 必填\n            ]\n            'cid' =\u003e 'target cid', // 推送通知至指定用户时填写\n            'cid_list' =\u003e ['cid1','cid2',...], // 推送通知至指定用户列表时填写\n        ];\n        ```\n        \n    * [点击通知弹窗下载模板](http://docs.getui.com/server/php/template/#3)\n        ``` php\n        $data = [\n            'template_type' =\u003e 3,\n            'template_data' =\u003e [\n                'title' =\u003e '', // 通知标题，string(40), 必填\n                'text'  =\u003e '', // 通知内容，string(600), 必填\n                'pop_title'   =\u003e '', // 弹出框标题，string(40), 必填\n                'pop_content' =\u003e '', // 弹出框内容，string(600), 必填\n                'pop_image'   =\u003e '', // 弹出框图标，string(200), 必填\n                'load_icon'   =\u003e '', // 下载图标: 本地图标[file://]， 网络图标[http:// 或 https://]，string(40), 必填\n                'load_title'  =\u003e '', // 下载标题，string(40), 必填\n                'load_url'    =\u003e '', // 下载地址，string(200), 必填\n                'is_auto_install' =\u003e true, // 是否自动安装（默认否），boolean\n                'is_actived'  =\u003e false, // 安装完成后是否自动启动应用程序（默认否），boolean\n            ]\n            'cid' =\u003e 'target cid', // 推送通知至指定用户时填写\n            'cid_list' =\u003e ['cid1','cid2',...], // 推送通知至指定用户列表时填写\n        ];\n        ```\n        \n    * [透传消息模版](http://docs.getui.com/server/php/template/#4)\n        ``` php\n        $data = [\n            'template_type' =\u003e 4,\n            'template_data' =\u003e [\n                'transmission_type' =\u003e 2, // 是否立即启动应用：1 立即启动 2 等待客户端自启动，必填\n                'transmission_content' =\u003e '', // 透传内容，不支持转义字符，string(2048), 必填\n                'is_ios' =\u003e false, // 是否支持 ios （默认不支持），boolean\n                'is_content_available' =\u003e false, // 推送是否直接带有透传数据（默认否）, boolean\n                'badge' =\u003e '', // 应用icon上显示的数字，int\n                'sound' =\u003e '', // 通知铃声文件名，string\n                'category' =\u003e '', // 在客户端通知栏触发特定的action和button显示，string\n                'custom_msg' =\u003e [\n                   'key1' =\u003e 'value1',\n                   'key2' =\u003e 'value2',\n                   ...\n                ], // 增加自定义的数据\n                'title' =\u003e '', // 通知标题，string\n                'text' =\u003e true, // 通知内容，string\n            ]\n            'cid' =\u003e 'target cid', // 推送通知至指定用户时填写\n            'cid_list' =\u003e ['cid1','cid2',...], // 推送通知至指定用户列表时填写\n        ];\n        ```\n    \n    * 注意事项：\n       * 配置中所有的变量都可以针对于某一条具体的推送自定义值，须放在 `template_data` 节点下\n       * 推送可定时展示，开始时间 `start_at` 与结束时间 `end_at` 必须同时设置（格式 `Y-m-d H:i:s`），否则无效\n       * 透传消息模版中，当 `is_content_available = false` 时，`title` 与 `text` 必填\n       \n    * 示例：\n       ```php\n       $data = [\n           'template_type' =\u003e 1,\n           'template_data' =\u003e [\n               'title' =\u003e 'Laravel Getui',\n               'text' =\u003e 'May you succeed.',\n               'transmission_type' =\u003e 1,\n               'transmission_content' =\u003e 'It is transmission content',\n               'is_ring' =\u003e false,\n               'is_clearable' =\u003e false,\n               'begin_at' =\u003e date('Y-m-d H:i:s'),\n               'end_at' =\u003e date('Y-m-d H:i:s', strtotime(\"+1 day\")),\n           ],\n           'cid' =\u003e 'target cid',\n       ];\n       ```\n* 返回值 `$rep`\n    * [推送结果返回值](http://docs.getui.com/server/php/push/#7)\n    \n* 版本更新说明：\n    * v0.1.2: \n        * Enhancement：点击通知打开应用模板和点击通知打开网页模板支持设置通知图标名称和通知图标 url 地址\n    * v0.1.1: \n        * Enhancement：IOS 透传消息模板中支持 category（在客户端通知栏触发特定的action和button显示）\n    * v0.1.0: \n        * 新功能：支持队列\n        * 针对 Laravel5.5LTS 新功能 Package Discovery 更新 `composer.json`\n        * 规范 coding style\n    * v0.0.3：修复 ios 透传消息无法增加自定义数据的 bug\n    * v0.0.2：向指定的用户列表推送消息\n    * v0.0.1：支持个推服务器端 PHP SDK 4.0.1.5\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcncal%2Fgetui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcncal%2Fgetui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcncal%2Fgetui/lists"}