foursquare-android-oauth

  •        0

Call `FoursquareOAuth.getConnectIntent()` with your application's client id to retrieve an intent that starts the Foursquare app for authentication. If the user doesn't have the app installed, or has an incompatible version installed, an intent that opens the Foursquare app page on Google Play is returned (you can check for this case with `FoursquareOAuth.isPlayStoreIntent(intent)`). Then call the `startActivityForResult()` method with the retrieved intent.```javaIntent intent = FoursquareOAuth.getConnectIntent(context, CLIENT_ID);startActivityForResult(intent, REQUEST_CODE_FSQ_CONNECT);```When the authorization completes, the `onActivityResult()` method of your initiating `Activity` or `Fragment` will be triggered. Call `FoursquareOAuth.getAuthCodeFromResult()` with the resultCode and data intent to obtain an `AuthCodeResponse` object.```java@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case REQUEST_CODE_FSQ_CONNECT: AuthCodeResponse codeResponse = FoursquareOAuth.getAuthCodeFromResult(resultCode, data); /* ... */ break; }}```The `AuthCodeResponse` object has two members:* `code` - The access code for the user.* `exception` - Exception of one of the following types: * `FoursquareCancelException` - User pressed the back button in the authorization screen. * `FoursquareDenyException` - User pressed the deny button in the authorization screen. * `FoursquareUnsupportedVersionException` - The version of the Foursquare app installed on the user's device is too old to support native auth. * `FoursquareInvalidRequestException` - Malformed connect request uri that the Foursquare app is not able to interpret, such as missing client id or version number. If you are using `FSOauth.getConnectIntent()` to start the oauth prcoess, you can ignore this exception as FSOauth creates the connect uri for you. * `FoursquareOAuthException` - An error occurred in the OAuth process. Call `FoursquareOAuthException.getErrorCode()` to obtain one of the error codes listed at http://tools.ietf.org/html/rfc6749

https://github.com/foursquare/foursquare-android-oauth

Tags
Implementation
License
Platform

   




Related Projects

Tweetphoto-api-java - General Java and Android Java library for TweetPhoto API


DescriptionThe TweetPhoto Java library for Android is a set of drop in classes designed to allow developers to get up and running quickly with the TweetPhoto Photo Sharing API. This library includes every feature you'll need to manage the entire photo sharing experience within your application - from uploading photos, commenting, favoritng, and voting to social feeds, user feeds, and everything in between. There is also a write up in the Wiki about Android camera usage to speed up your developme

Foursquare-android-sdk - For using foursquare apiv2


For using foursquare apiv2 It's base on oauth2 api. Simple to use like facebook android sdk This repository move to github https://github.com/jiramot/foursquare-android-sdk

Androidoauth2 - A turn key implementation of oauth2


Provides authentication and signing mechanism for using oauth2 on andriod

android-foursquare


This Android project demonstrates authenticating via foursquare and accessing the foursquare API v2 via oauth2. This project uses a hacked version of https://github.com/jiramot/foursquare-android-sdk.

generic-oauth2-login-for-android


Generic OAuth2 login implementation for Facebook, Foursquare, Gowalla, ...