当前位置:网站首页>App uses the template message from WeChat official account for message push.
App uses the template message from WeChat official account for message push.
2022-04-23 01:04:00 【Yu Nianyu Hui】
Development background
To save money , Keep alive 、 On the tall .
Environmental preparation
- Application for official account ;
- Open wechat authentication (300 element / year );
- Apply for wechat open platform ;
- Buy a domain name and file it (100 yuan /3 year );
- Buy a server and resolve the domain name to the server (299 element /3 year );
Realization principle
- User download app And log in using wechat , Get wechat openid;
- take openid、 cell-phone number 、 equipment IMEI、 And user information post Save in the background ;
- When message push is triggered ( Such as equipment alarm ), according to openid Push relevant information to specified users ;
Pit in practice
One 、 Application for official account
At first, I didn't pay attention to , The official account is directly applied to subscribe. , When I went in, I found that I couldn't find the template message , Second, there is no way to conduct wechat authentication ;
solve : Apply for a new service number ;
Two 、 Open wechat authentication
Select industrial and commercial business when uploading the business license **( A little forgotten ), Choose the combination of three certificates at the beginning , The audit failed ; The second is that you will receive a call from Tencent to the public account 0.01 element , Then when I receive a call from the staff, I will ask how much the money is , What time , You need to see it in advance ;
Because of the above two questions, I have been wrong twice , The staff will prompt that if you make another mistake, you will need to resubmit the application , It means to hand it in again 300 $certification fee , Recertification ;
3、 ... and 、 Apply for wechat developer account
When entering the wechat open platform for account application , Change which mailbox will prompt that it has been used , But when it is used to retrieve the password, it indicates that it has not been registered .
Finally, I learned from various communities , This mailbox must not be bound to any Tencent product .
solve : It is suggested to untie and re apply , My solution is that I don't need it directly , Switch to web authorization mode for acquisition openid;
Four 、 obtain openid( Code gate )
Unable to apply for wechat open platform account , Therefore, it can only be obtained by using the web page authorization mode openid, I've fallen into a big pit here , A big push file , I don't know where it is , You can only try it step by step ;
The first is acquisition code I need a appid and redirect_uri token url , This appid It's easy to see ( Development 》 Basic configuration 》 Official account development information ) You can set . But this callback address makes me angry , There is also a server configuration below , I always thought this was where the callback address was configured , It's been all morning token Authentication failed ( It is mainly to find relevant instructions on the official website );

When I couldn't find a solution on the official website, I began to ask Du Niang , Fortunately, omnipotent netizens shared the solution , this TM It's not configured here at all , See the figure below for details .

From here to put the business domain name 、JS Interface security domain name 、 The authorized domain names of web pages are configured , This is the question of understanding ;
6、 ... and 、 Message template push
If you want to get ahead openid There are too many and scattered interface description documents , The template message push interface is much simpler , It was so simple that I had to go through all the documents again to find this ACCESS_TOKEN North Africa ACCESS_TOKEN;
Obtained directly with web authorization ACCESS_TOKEN The template message push request will be reported 40001 Error of ;

So specific ACCESS_TOKEN And which one ? Look here I think I saw it in my bag , The ignorant force in front has great stamina , I haven't woken up yet ;

7、 ... and 、 For people who can't drink, ignorance also has stamina
I thought everything was ready here , I didn't expect to find this force in the code, since it is still there . So where exactly ? The reason is that we didn't add IP White list , Once you master this thing, you can't have infinite stamina , Let's take a look at the specific settings .

At the end

Failure is not a success. His mother. , At best, it's his ex girlfriend , Finally, let's settle an account , The official account message is not worthwhile pushing him. .
| Expense items | Amount spent / element | Project duration / year |
|---|---|---|
| Wechat Authentication | 300 | 1 |
| domain name | 100 | 3 |
| The server | 299 | 3 |
| A total of | 1299 | 3 |
From the book point of view, it is more cost-effective , After all, third-party push is not very cheap now , Hope it can be helpful to you who have relevant needs , I quit .
版权声明
本文为[Yu Nianyu Hui]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230057108099.html
边栏推荐
- [actf2020 freshman competition]
- 10月24号是什么?中国的高级程序员为什么没有五六十岁的,而国外人、、、,玉念聿辉带你过1024程序员节日
- What is tooljet and how about it—— Evaluation of low code development platform
- Terminal mobile JD Mall
- 2.60 - suppose we number the bytes in a W-bit word from 0 (lowest bit) to w / 8 - 1 (highest bit). Write the code of the following C function, which will return an unsigned value, in which byte I of p
- Design and application of intelligent lighting control system in hospital
- Analysis and configuration process of epit periodic timer for imx6ull bare metal development
- io_ Application of ring technology in distributed cloud native database
- L2-012 judgment on heap (25 points) (string bug to be solved)
- What happens when you run the NPM install command?
猜你喜欢

Cloud native Virtualization: building edge computing instances based on kubevirt
![[HCTF 2018]admin](/img/08/8111f2f87796dda8dd6b0dcf72c42b.png)
[HCTF 2018]admin

GPT general timer analysis and configuration process of imx6ull bare metal development

Multi surveyor Xiao sir, Gongshu campus, Hangzhou_ Senior gold medal lecturer_ Resume making explanation

Vs + C realizes that the form input box displays gray text by default

Originally, this is the correct posture for developers to open world book day!

How does zhiting connect Xiaomi smart speakers?

IMX6ULL裸机开发之硬件SPI分析及配置过程

Acrel-2000型电力监控系统在兴庆坊新兴广场配电所配电回路用电的实时监控和管理

What does Huiliang technology rely on to "build a bridge" for enterprises to go to sea?
随机推荐
Type conversion in C - Custom implicit and explicit conversion
【Android工程师与智能家居产品的第一次接触③】SmartConfig一键配网在硬件端的具体实现|ESP8266一键配网在Arduino的具体实现|玉念聿辉
Research and application of Acrel-5000 building energy consumption monitoring system in Xixian Airport Garden Project
API IX JWT auth plug-in has an error. Risk announcement of information disclosure in response (cve-2022-29266)
Pilotage growth · ingenuity empowerment -- yonmaster developer training and pilotage plan is fully launched
[HCTF 2018]admin
On the soft test, these common questions must be understood
Processus d'analyse et de configuration du matériel IIC pour le développement de la machine nue imx6ull
10月24号是什么?中国的高级程序员为什么没有五六十岁的,而国外人、、、,玉念聿辉带你过1024程序员节日
"Open source summer" activity is hot. In the registration, rich bonuses are waiting for you to get!
Application of acrel-3200 remote prepaid electric energy management system in Fuzhou Wanbao Industrial Park
SSM framework
Daily practice (47): find different
VS+C# 实现窗体输入框默认显示灰色文字
Buuctf missing through time and space
Acrel-5000型建筑能耗监测系统在西咸空港花园项目的研究与应用
[actf2020 freshman competition]
What is the legal basis and procedure for Tami dog sharing | state owned equity transfer?
Research and application of power monitoring system for employee apartment building construction project
Let's talk about ruby