What is a Geolocation API and how is it used? - PubNub

文章推薦指數: 80 %
投票人數:10人

A Geolocation API is a communication interface between a client device or application (client-side), and an application or service (server-side) that ... WatchNow→EventsandActionsislive!Checkoutourwebinaronthisnewfeature.BlogSupportDocumentationLoginPubNubSearch.SolutionsSolutionsDropdownIn-AppChatSecureone-to-one,group,orliveeventin-appchatGeolocationLocation-basedmappingandeventsVirtualEventsEffortlesslyreachlargeaudiencesinrealtimePushNotificationsIn-appalertsandmobilepushnotificationsIoTMonitoringandcontrolofdevicesandsystemsDataStreaming&DashboardsPublish,monitor,andanalyzedatainrealtime.UseCasesUseCasesDropdownGamingEnhanceplayerengagementwithin-gamechatandleaderboardsTelemedicineProvidehigh-qualityremotecarewithHIPAA-compliantchatE-LearningBuildengagingvirtualclassroomswithsharedwhiteboardsandchatLiveEntertainmentCreatelivelyeventsatscalewithunlimitedchannelsandconcurrentusersFleetTransportationandDeliveryOptimizedispatchanddeliverywithreal-timelocationtrackingMarketplacesCapturebuyers’attentionwithreal-timepricingandnotificationsPricing.ResourcesResourcesDropdownBlogCaseStudiesGuideseBooksDatasheetsWhitePapersWebinarsPodcastAboutUs.OurPlatformPlatformExplorePubNubLearnhowthePubNubplatformworksPubNubTourExplorePubNub'scorefeatureswithourinteractiveandlive-codetourSeehowwecompareLearntheuniquefeaturesofPubNubcomparedtootherreal-timeprovidersIntegrationsAdd3rd-partyintegrationswithAPIsyouknowandlovePubNubFunctionsRunserverlessbusinesslogiconyourPubNubmessages.DevelopersDocumentationHomeParentPubNubDevelopersEverythingyouneedtogetbuildingwithPubNubinoneplaceGETSTARTEDDocumentationHomeStartbuildingwithPubNub’sSDKs,APIsand3rdpartyintegrationsHow-ToGuidesGetthemostoutofPubNubwithourhow-toguidesTutorialsBuildyourapplicationwiththesestep-by-stepinstructionsEXPLOREDeveloperPathsAlltheresourcesyouneedinoneplacetobuildreal-timeappsforChat,IoT,Virtualeventsandmore.DemosExplorereal-timedemosforChat,IoT,GeolocationandmoreFixedMenuforNetworkStatusNetworkStatusSearchContactSalesTryforfree. Real-timeTechnologyGlossaryAnever-growingrepositoryoftechnicaltermsaroundreal-timetechnologyandbeyond.Glossary»W»WhatisaGeolocationAPI&howisitused?WhatisaGeolocationAPI? AGeolocationAPIisacommunicationinterfacebetweenaclientdeviceorapplication(client-side),andanapplicationorservice(server-side)thatidentifiesandreturnsinformationabouttheclient’sgeographicalposition.Additionalinformationaboutthelocationsuchastimezone,currencyorcountrycanbedeterminedthroughgeocoding. Itiscalledwhenthereisaneedtoprogrammaticallyconfigureawebormobileapplicationbasedontheuser'slocationandcommonusecasesincludereal-timemapnavigationandgeotracking,servingcontextualadvertisements,implementingusersecuritychecks,andtailoringcontenttocertainregions. TheGeolocationAPIdoesnotstoreanyinformationinitself,butratherprovidestheabilitytogatherexistinginformationfromthedevicebeingqueried.ItcancollectlocationinfofromsourcessuchasIPAddress,GPS,WiFi,Bluetooth,RFID,GSM/CDMAID,oruserinput.OnceanAPIqueryiscompleted,a"best-guess"geographicpositionwithcoordinatesisreturnedtothecallingapplicationinJSON. Note:Ausermustexplicitlygrantpermissionforanapplicationtoaccesstheirlocation. HowDoesaGeolocationAPIWork? GeolocationInputParameters Typically,arequestforlocationinformationtoaGeolocationIPisfromadevice,e.g.acomputerormobilephone,whichprovidesoneormoreofthefollowinginputparameters:anIPaddress,MACaddress,RFID,GPScoordinates,celltower(e.g.GSM,WCDMAorCDMA)IDorWiFiposition.Ausercanalsorequestgeographicpositioninformationaboutaplaceororganizationbyname. GeolocationOutputParameters TheAPIqueriesaLocationInformationServer,whichrepliestoitwithvariouslocationproperties,includingtheaccuracyoftheinformationitispassingon.TheAPIthenreturnsthisinformationtotheclient.WheretheinformationcomesfromistransparenttotheAPIandtheAPIdoesnotitselfstoreanydata. TheinformationatypicalGeolocationAPIprovidesvariesbutmayincludethefollowing: Physicaladdress,throughreversegeocoding-E.g.country,city,region,continent,postalcode,andwhetherthecountryisamemberoftheEU. Latitudeandlongitude-Includingaccuracy,altitude,andspeed. Localdata,throughreversegeocoding-Timezone(includingdaylightsavingtime),language(includingmultipleofficiallanguages)andcurrency(includingcurrencysymbolanddescription)data. Properties GeolocationAPIsareavailableforwebpagesandweb-basedapplicationsdeliveredthroughtheGeolocationpropertywhichispartoftheNavigatorobject. NativeandricherlocationAPIsarealsoavailableforbothAndroidandiOS. All3platforms(web,Android,iOS)willoffer  Theabilitytoretrievethecurrentdevicelocation,returnedasalatitude,longitudepairalongwithaccuracy,height,altitude,andspeed(ifknown) Theabilitytowatchforchangesinpositionandregisteracallbacktobeinvokedwhenthedevicepositionchanges AndroidandiOSwillalsodifferentiatebetween‘fine’locationand‘coarse’locationtoenhanceuserprivacyandthetrade-offbetweenperformanceandaccuracy. Whereapplicationusecasesallow,theappshouldusethefeaturewhereacallbackisinvokedwhenausergoesnearalocation(knownas‘visitslocationservice’oniOSand‘geofence’onAndroid)sincethisisthemostpower-efficientAPI. WherenativeorwebAPIsarenotanoption,forexamplewhenrunningonanIoTdevice,thereareamyriadofRESTlocationAPIsavailable UseCases Geolocationisusedprimarilytogeographicallycustomizeauser’sdigitalexperience. BrowserContext-Whenyouaresearchingtheinternet,yourbrowsermaywanttoqueryyourlocationinordertoprovidelocale-specificinformationthatisrelevanttoyourquery,e.g.businesseslocatedinyourareaoftheUnitedStatesorlocalnews. WeatherReports-Ifyouwanttochecktheweatheronyourphone,thedevicewillneedLocationsettoONinthephone’sSettings. SocialMediaUpdates-ApplicationslikeFacebookuselocationAPIssouserscantagtheirlocationsintheirstatusupdates,e.g.showtheirfriendswheretheyarevacationing. EmploymentandBusinessNetworking–Jobsearchingwebsitesusegeolocationtomatchjobsearcherswithopportunitiesavailableintheirarea. DigitalMaps-Lostinastrangecity?UseyourphonetopinpointyourlocationandfindthefastestroutetoyourhotelusingGoogleMaps. MarketingandCustomerEngagement-WebapplicationsuseaGeolocationAPItomonitorauser’spositionwhenthey’reoutandabouttown.Forinstance,whenapersongoesshopping,anapplicationmayalertthemtocurrentspecialsinaparticularstoreorsuggestrestaurantsintheareabasedonauser’spreviouslydiscernedculinarypreferences. TrackingIoTDevices-Smarthomedevicesorwearables,andvehiclescaneasilybetrackedorlocatedwithgeolocation. Cybersecurity-Geolocationcanbeusedtotracknetworkintrudersorsuspicioussystemlogins;identifywhenandwherefishyonlinetransactionsaremade;anddiscovertheshadyorganizationbehindanIPaddress. RelatedTerms DirectionsAPI GIS MapAPI YoumightalsolikeGeolocationTrackingTutorialInthistutorialyou’lldiscoverhowtobuildageolocationtrackingappthatallowsuserstosharelocationsandsendmessagesinreal-time. Youwilldevelopageolocationtrackingapplicationthatallowsparticipantstolocateandinteractwitheachother,basedonPubNub'sJavascriptSDK.LearnMoreGeolocationDemoGeolocationconnectsusersaroundtheworldempoweringthemtoshareinformationandexperiencesinreal-timefromanydevice. ThisdemoshowshowyoucouldusePubNubtoshareyourlocationExperiencetheDemo ReadyToGetStarted? ContactSales



請為這篇文章評分?