Home >
WeChat Applet >
WeChat Development >
C# develops WeChat portals and applications using geographical location to expand related applications
C# develops WeChat portals and applications using geographical location to expand related applications
高洛峰
Release: 2017-03-01 10:33:24
Original
1425 people have browsed it
This article continues the previous article "C# Development of WeChat Portal and Applications (12)-Using Speech Processing" and continues to introduce WeChat related applications. We know that geographical location information can be used for many related applications. In addition to knowing the user's location, we can also associate some geographical location applications, such as weather, popular movies, nearby attractions, nearby theaters, traffic events, etc. Etc. Anyway, for all information related to geographical location, we can make some extended applications as needed. This article mainly introduces how to use geographical location information to build operations that use these applications.
1. WeChat’s geographical location information
Before using it, let’s take a look at WeChat’s interface, which defines for us those information about geographical location. Information. In fact, the geographical location information is divided into two aspects on WeChat. One is to receive the user's geographical location request, and the other is the geographical location information that the user allows to report the geographical location operation and is sent regularly.
This article mainly introduces related applications based on the first type, how to process the user's geographical location after reporting it.
The geographical location reporting operation is to select the + sign to add the geographical location where you enter it, and then select the current or specified geographical location map. The specific operation is as follows.
/// <summary>
/// 其他插件操作,如天气,景点、电影影讯、交通等
/// </summary>
/// <param name="info">基础消息</param>
/// <param name="eventKey">事件标识</param>
/// <returns></returns>
public string DealPlugin(BaseMessage info, string eventKey)
{
//LogTextHelper.Info(eventKey);
string userInput = BLLFactory<UserSet>.Instance.GetUserInput(info.FromUserName);
string xml = "";
switch (eventKey)
{
case "event-void-wether":
xml = new WeatherPlugin().Response(info, userInput);
break;
case "event-void-movie":
xml = new MoviePlugin().Response(info, userInput);
break;
case "event-void-cinema":
xml = new CinemaPlugin().Response(info, userInput);
break;
case "event-void-travel":
xml = new TravelPlugin().Response(info, userInput);
break;
case "event-void-traffic":
xml = new TrafficEventPlugin().Response(info, userInput);
break;
default:
break;
}
return xml;
}
For more C# development of WeChat portals and applications using geographical location to expand related applications, please pay attention to the PHP Chinese 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