Comments (13)
你是不是写了存储和读取的回调函数,你可能没有处理好这个问题
from wechat-api.
from wechat-api.
@XGHeaven 就是上面这种代码
from wechat-api.
我的意思是你是不是在实例化 api 的时候,传入的读取和存储的回调函数出现了一些问题?能上一下代码么?
from wechat-api.
代码其实挺简单,就是循环openid 推送数据,但是每循环一次 就使用一次 token
from wechat-api.
这样子调用肯定会出问题的。
from wechat-api.
@JacksonTian 那怎么循环openid进行推送呢
from wechat-api.
api.getLatestToken(function () {
for () {
api.sendText();
}
});
你可以在应用启动之前调用下这个函数,预先让token准备好。
from wechat-api.
@JacksonTian 我现在就是这样做的 预先获取到token 然后 传给sendText
from wechat-api.
不需要你每次都这么做。应用启动的时候做一次就行了。
from wechat-api.
恩,另外 现在服务号 给用户进行推送也是需要 交互在 24小时之内吗,很多用户都是没在24小时之内交互的 隔一天的。
from wechat-api.
这些规则 仔细看腾讯的文档
from wechat-api.
@JacksonTian 我记得可能会发生这样的问题,就是在重新获取token的时候,又发送了一次请求,这次请求一样需要重新获取token,就会获取两次token,而发生覆盖
from wechat-api.
Related Issues (20)
- WeChatAPIJSONResponseFormatError
- 无限重复的post请求 HOT 2
- 什么时候能支持发送【小程序】图文链接? HOT 2
- lib/api_metrial.js HOT 1
- 上传永久素材
- 永久二维码现在支持字符串形式了 希望更新 HOT 1
- getMaterial 接口返回Buffer HOT 1
- WeChatAPIError: 40001
- 40001错误 HOT 1
- Error code: 48001, message: api unauthorized HOT 2
- 如何把 getMaterial 返回的 Buffer 保存为文件? HOT 2
- 上传多媒体的接口貌似不通了, 望你们测试一下 HOT 1
- Error code: 48001: unauthorized api in wechat shop HOT 1
- 希望可以支持下typescript HOT 1
- domain doxmate.cool is expired HOT 4
- 获取二维码地址后,上传到临时素材报错,望指导。 HOT 1
- api文档错误 HOT 1
- 支持MAC和IPAD协议新微信号接入,做机器人,营销系统,客服系统,监管系统的可以看下这个API :http://www.bbaos.com/docs/index HOT 1
- 找不到 doxmate.cool 的服务器 IP 地址。 HOT 1
- 需要最新iPAD协议联系(v:ixiaohe_) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wechat-api.