PHP code example of siaoynli / laravel-alicloud-emas

1. Go to this page and download the library: Download siaoynli/laravel-alicloud-emas library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

siaoynli / laravel-alicloud-emas example snippets



use Siaoynli\AliCloud\EMas\Facades\EMas;
//单客户端
EMas::device("IOS")->deviceId("f72fb02413304ad8a16c017c3a")->push("测试","测试包");
//所有客户端
EMas::device("IOS")->deviceId("ALL")->push("测试","测试包");

EMas::pushType("NOTICE")->device("IOS")->target("ALL")->deviceId("ALL")->push("测试","测试包");

//成功
{
"state": 1,
"info": {
          "RequestId": "4AC202AB-87CE-4641-A02E-5FBCF99DF336",
          "MessageId": "2386074847883392"
        }
}
//失败
{
"state": 0,
"info": ""
}




php artisan vendor:publish --provider="Siaoynli\AliCloud\EMas\LaravelAliCloudEMasServerProvider"

 "EMas" => \Siaoynli\AliCloud\EMas\Facades\EMas::class,