<p>Telegram allows sending the live geolocation of a user in a chat, optionally setting a proximity alert. </p>
<h3><aclass="anchor"href="#sending-live-locations"id="sending-live-locations"name="sending-live-locations"><iclass="anchor-icon"></i></a>Sending live locations</h3>
<p>To send a live geolocation, use <ahref="/method/messages.sendMedia">messages.sendMedia</a> with an <ahref="/constructor/inputMediaGeoLive">inputMediaGeoLive</a><code>media</code> . </p>
<p>The <ahref="/constructor/inputMediaGeoLive">inputMediaGeoLive</a> allows sending the geolocation as an <ahref="/constructor/inputGeoPoint">inputGeoPoint</a> with floating point latitude and longitude, with an optional <code>accuracy_radius</code> in meters.<br>
Clients can also provide a <code>heading</code>, a direction in degrees (1-360) that can be used to indicate the direction of the user, a validity <code>period</code> for the current location, and a <code>proximity_notification_radius</code> . </p>
<p>The sent geolocation should be updated periodically using <ahref="/method/messages.editMessage">messages.editMessage</a><strong>at most</strong> every <code>period</code> seconds, in order to implement the "live" part of live geolocations. </p>
<p>To stop sharing the location, pass <ahref="/constructor/inputGeoPointEmpty">inputGeoPointEmpty</a> as location and set the <code>stopped</code> flag to true in a last <ahref="/method/messages.editMessage">messages.editMessage</a> call. </p>
<h3><aclass="anchor"href="#receiving-live-locations"id="receiving-live-locations"name="receiving-live-locations"><iclass="anchor-icon"></i></a>Receiving live locations</h3>
<p>Clients will receive a message with a <ahref="/constructor/messageMediaGeoLive">messageMediaGeoLive</a>, containing the information passed by the sender; when the geolocation message is marked as read, an <ahref="/constructor/updateGeoLiveViewed">updateGeoLiveViewed</a> is generated. </p>
<p>Periodically, the geolocation will be updated with <ahref="/constructor/updateEditMessage">updateEditMessage</a>/<ahref="/constructor/updateEditChannelMessage">updateEditChannelMessage</a> updates. </p>
<p>A map preview can be generated by passing the received <ahref="/constructor/geoPoint">geoPoint</a> to <ahref="/api/files#downloading-webfiles">upload.getWebFile</a>, to download an image preview of the map. </p>
<ul>
<li><code>geo_point</code> is generated from the <code>lat</code> , <code>long</code><code>accuracy_radius</code> parameters of the <ahref="/constructor/geoPoint">geoPoint</a></li>
<li><code>access_hash</code> is the access hash of the <ahref="/constructor/geoPoint">geoPoint</a></li>
<li><code>w</code> - Map width in pixels before applying scale; 16-1024</li>
<li><code>h</code> - Map height in pixels before applying scale; 16-1024</li>
<li>A user sets a <code>proximity_notification_radius</code> when sending a location</li>
<li>Multiple users share their location within the same chat</li>
<li>One of the other users comes within <code>proximity_notification_radius</code> meters of the first user, and updates their location accordingly</li>
</ul>
<p>An <ahref="/constructor/updateNewMessage">updateNewMessage</a>/<ahref="/constructor/updateNewChannelMessage">updateNewChannelMessage</a> is generated for all chat members, containing a <ahref="/constructor/messageService">messageService</a> with action <ahref="/constructor/messageActionGeoProximityReached">messageActionGeoProximityReached</a>:</p>
<ul>
<li><code>messageActionGeoProximityReached.to_id</code> is the peer that enabled proximity alerts</li>
<li><code>messageActionGeoProximityReached.from_id</code> is the peer that is now in proximity of <code>messageActionGeoProximityReached.to_id</code></li>
<li><code>messageActionGeoProximityReached.distance</code> is the distance between them, in meters</li>
</ul></div>
</div>
</div>
</div>
<divclass="footer_wrap">
<divclass="footer_columns_wrap footer_desktop">
<divclass="footer_column footer_column_telegram">
<h5>Telegram</h5>
<divclass="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.