Can I reply with different content according to different cities when following on WeChat for the first time?

WBOY
Release: 2016-07-06 13:52:03
Original
852 people have browsed it

Looking at the documentation, it doesn’t seem to work.
Please give me some guidance.

Reply content:

Looking at the documentation, it doesn’t seem to work.
Please give me some guidance.

There is no good method. The city in the user information will be very inaccurate. Many users fill in the city information of their hometown, not their current location. When WeChat pushed attention events, it did not push the user’s IP

Sure. . When following the push, get the user information, which contains city, but the user must also fill in the information. . . . Another option is for the user to report their geographical location, but this is triggered when there is no way to pay attention to it, and the user can disagree.

Yes, but it’s a bit troublesome.

  1. When the system background receives the information pushed by WeChat, it determines whether it is the user's attention

  2. If the user is paying attention, the user’s openid will be obtained based on the received information

  3. Go to the WeChat server to obtain user information based on openid

  4. Reply with different content based on the city field obtained from the user information

Note: When receiving a WeChat message push, you must respond immediately within 5 seconds. If there is no response, multiple identical messages will be sent, resulting in repeated processing on your side

When paying attention, you can receive the user's information in the server background (how to get it? See the documentation). You can reply to the user with different content based on the city in the user's information

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template