TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Sep 2015 |
Maintained by Darshan Patel.
GPlaceAPI is an open-source iOS Objective-C library for fetching Google Places API using simple blocks based API callbacks.
Its Main purpose it to use Google Places API requests with ease in a less lines of code.
This includes following:
You can take a look at the detailed example usage project GPlaceAPIExample/GPlaceAPIExample.xcodeproj.
#import "GPHeader.h"
In order to communicate with a Google Places API, you must first generate your own API key. Please take a look at Introduction - Google Places API.
You must provide API key to a GPlaceAPI
before making any request using it.
//Open "AppDelegate.h" and set your API_KEY
[[GPlaceAPISetup sharedInstance] setApi_Key:@"SET_API_KEY"];
CLLocationCoordinate2D location = CLLocationCoordinate2DMake(51.501103,-0.124565);
GPPlaceSearchRequest *request =[[GPPlaceSearchRequest alloc] initWithLocationCoordinate:location];
request.radius = 5000;
[request doFetchPlaces:^(GPPlaceSearchResponse *response, NSError *error) {
if(!error){
if(response.status == GPRequestStatusOK) {
// Access place results by below model
GPResult *result =response.results[0];
NSLog(@"%@",result.name);
}
}
}];
Please check Google Places API documentation for request and resonse. you can search all request parameters and get response of all objects mentioned in Google Places API documentation.
GPlaceAPI is developed by Darshan Patel. Please email to let me know you how you are using this library and anything related to this library.
Pull requests are very welcome expecting you follow few rules:
The MIT License (MIT)
Copyright (c) 2015 Darshan Patel
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.