Skip to content

sternhenri/Foursquare-API-v2

 
 

Repository files navigation

#Foursquare API 2.0 For iOS and MacOS

###Features

  • In-App Authentication
  • Asynchronous requests with blocks
  • Build-in image uploader for photos.
  • Made with native framworks:
    • NSJSONSerialization for JSON parsing
    • NSURLConnection for requests

###How To

  1. Create Your application here https://foursquare.com/developers/register

  2. Setup Foursquare to use your credentials

     - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
         [Foursquare2 setupFoursquareWithKey:YOUR_KEY
                                      secret:YOUR_SECRET
                                 callbackURL:YOUR_CALLBACK_URL];
     }
    
  3. You need to make sure you set up the URL scheme in your info.plist properly

CFBundleURLTypes -> CFBundleURLName -> CFBundleURLSchemes -> {app_id}

###Usefull tips

  1. How to get sw and ne from MKMapView?

     CGPoint swPoint = CGPointMake(mapView.bounds.origin.x, mapView.bounds.origin.y+ mapView.bounds.size.height);
     CGPoint nePoint = CGPointMake((mapView.bounds.origin.x + mapView.bounds.size.width), (mapView.bounds.origin.y));
    
     //Then transform those point into lat,lng values
     CLLocationCoordinate2D swCoord;
     swCoord = [mapView convertPoint:swPoint toCoordinateFromView:mapView];
    
     CLLocationCoordinate2D neCoord;
     neCoord = [mapView convertPoint:nePoint toCoordinateFromView:mapView];
    

###Screnshots

##My other usefull libs CFAsyncImageView - is simple subclass of UIImageView for async downloading image. Very simple and powerfull. No extra code. I use native NSCache class for in-memory image caching.

I got blue pin here.

About

Foursquare API v2 For iOS and MacOS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 99.0%
  • Ruby 1.0%