public async Task FindGeoDataSuccessTest()
        {
            var accessTokenFB   = "CAAFYnUVKERcBAPPgCYPqm4UZB19SZBZAlkTMQMhZByMipETIJfeZAbjVYp6xf9usgAbxRsLEmvsuPHzgASr4HW62Bj71HKGgDBTdq4PamjQWpQgBbm9OVHoDoJPMluxLOZA73KVfMS5OeL529WCYJbdRTgAgNcZAlrQxRZBTcFknwJZC5bZCNiGhbbjTDE6DcZAbWcZD";
            var sessionResponse = await client.AuthenticationClient.CreateSessionWithSocialNetworkKey("facebook",
                                                                                                      "public_profile",
                                                                                                      accessTokenFB,
                                                                                                      null,
                                                                                                      null);

            this.client.Token = sessionResponse.Result.Session.Token;

            var findFilterRequest = new FindGeoDataRequest();

            //findFilterRequest.UserId = 2701456;

            // https://api.quickblox.com/geodata/find.json?current_position=25.34336612%3B-5.34546612&radius=1000&page=1&per_page=10
            findFilterRequest.CurrentPosition = String.Format("{0}%3B{1}", 25.34336612, -5.34546612);
            findFilterRequest.Radius          = 100;
            var getResponse = await this.client.LocationClient.FindGeoDataAsync(findFilterRequest);

            Assert.AreEqual(getResponse.StatusCode, HttpStatusCode.OK);
            Assert.IsNotNull(getResponse.Result);
        }
Beispiel #2
0
        /// <summary>
        /// Retrieve all (by default) geodata for current application. The ID of the application is taken from the token which is specified in the request
        /// </summary>
        /// <param name="findGeoDataRequest">
        /// Filters
        /// The request can contain all, some or none of these parameters.If this option is set,  its value - the object to validate.
        /// Filters require an exact match property values ​​with an instance of the corresponding parameter value.
        /// </param>
        /// <returns>Success HTTP Status Code 200</returns>
        public async Task <HttpResponse <PagedResponse <GeoDatumWithUserResponse> > > FindGeoDataAsync(FindGeoDataRequest findGeoDataRequest)
        {
            var headers            = RequestHeadersBuilder.GetDefaultHeaders().GetHeaderWithQbToken(this.quickbloxClient.Token);
            var getGeoDataResponse = await HttpService.GetAsync <PagedResponse <GeoDatumWithUserResponse>, FindGeoDataRequest>(this.quickbloxClient.ApiEndPoint,
                                                                                                                               QuickbloxMethods.FindGeoDataMethod,
                                                                                                                               findGeoDataRequest,
                                                                                                                               headers);

            return(getGeoDataResponse);
        }