Commit b2599642 by lanrion

updated README.md

parent 55b4c1ff
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
## 重要通知 ## 重要通知
目前 "发送图片消息", "发送语音消息", "发送视频消息", "发送音乐消息", 还未写好测试,其他均已经正常。 目前 "发送图片消息", "发送语音消息", "发送视频消息", "发送音乐消息" 这三部分需要结合上传文件API方能测试,其他均已经正常。
**注意:** 如果此信息一直存在,表示仍然没有跑完正常测试!! **注意:** 如果此信息一直存在,表示仍然没有跑完正常测试!!
...@@ -10,8 +10,6 @@ ...@@ -10,8 +10,6 @@
`gem 'weixin_authorize', git: "https://github.com/lanrion/weixin_authorize", branch: "master"` `gem 'weixin_authorize', git: "https://github.com/lanrion/weixin_authorize", branch: "master"`
我会尽快寻找机会获取有通过微信认证的服务号跑通测试。
## Installation ## Installation
Add this line to your application's Gemfile: Add this line to your application's Gemfile:
...@@ -116,6 +114,21 @@ $client ||= WeixinAuthorize::Client.new(ENV["APPID"], ENV["APPSECRET"]) ...@@ -116,6 +114,21 @@ $client ||= WeixinAuthorize::Client.new(ENV["APPID"], ENV["APPSECRET"])
`$client.send_news_custom(to_user, *articles)` `$client.send_news_custom(to_user, *articles)`
## How to test
Go to https://github.com/lanrion/weixin_authorize/issues/2, apply a weixin sandbox test account and follow this account, then add them to your `~/.bash_profile`
```
export APPID="your test account weixin app_id"
export APPSECRET="your test account weixin appsecret"
export OPENID="your weixin openid"
```
Last, you have to ** open a new terminal tag ** (Reload bash_profile), and run `rspec .`
## ##
> 对于多用户微信营销平台的对接,需要把每次的expired_at, access_token保存在Redis中,每次使用,则可以从Redis中获取expired_at和access_token, 即 `@client = WeixinAuthorize::Client.new(appid, appsecret, expired_at, access_token)`, 获取access_token,则仍然是:`@client.get_access_token`来获取. > 对于多用户微信营销平台的对接,需要把每次的expired_at, access_token保存在Redis中,每次使用,则可以从Redis中获取expired_at和access_token, 即 `@client = WeixinAuthorize::Client.new(appid, appsecret, expired_at, access_token)`, 获取access_token,则仍然是:`@client.get_access_token`来获取.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment