Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

公众号选项信息处理

wangyi edited this page Jan 14, 2017 · 3 revisions

公众号选项信息处理

代码示例

$config = [
    'debug'                => true,
    'component_app_id'     => 'wxd954……',                                   //第三方平台app id
    'component_app_secret' => 'a7a48d271…………',                              //第三方平台app secret
    'token'                => 'easy-open-wechat-token',                     //公众号消息校验Token
    'aes_key'              => '90ID6sSTuY……Uh6BWDct',                       //公众号消息加解密Key
    'redirect_uri' => 'http://yourhostname/authcallback.php',               //公众号授权回调页面
    'log' => [
        'level' => 'debug',
        'file'  => '/tmp/easyopenwechat.log',
    ],
];
//公众号ID
$appId = '';

$app = new \Chunhei2008\EasyOpenWechat\Foundation\Application($config);

//AuthorizerOption对象,可以用来获取和设置授权公众号的选项信息
$authorizer_option = $app->option->setAuthorizerAppId($appId);

//通过$authorizer_option获取或者设置option信息
$authorizer_option->getAuthorizerOption($optionName);  
$authorizer_option->setAuthorizerOption($optionName, $optionValue);
   
$authorizer_option->getLocationReport();
$authorizer_option->getVoiceRecognize();
$authorizer_option->getCustomerService();


$authorizer_option->setLocationReport($optionValue);
$authorizer_option->setVoiceRecognize($optionValue);
$authorizer_option->setCustomerService($optionValue);
 

Clone this wiki locally