forked from foursquare/foursquare-ios-oauth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTJFoursquareAuthentication.h
36 lines (27 loc) · 1.36 KB
/
TJFoursquareAuthentication.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// TJFoursquareAuthentication.h
// Quotidian
//
// Created by Tim Johnsen on 2/16/18.
//
#import <Foundation/Foundation.h>
@protocol ASWebAuthenticationPresentationContextProviding;
NS_ASSUME_NONNULL_BEGIN
@interface TJFoursquareAuthentication : NSObject
/**
* Invoke this to initiate auth
* @param clientIdentifier Your registered Foursquare client identifier.
* @param clientIdentifier Your registered Foursquare redirect URI.
* @param clientIdentifier Foursquare client secret.
* @param completion Block invoked when auth is complete. @c accessToken will be @c nil if auth wasn't completed.
*/
+ (void)authenticateWithClientIdentifier:(NSString *const)clientIdentifier
redirectURI:(NSURL *const)redirectURI
clientSecret:(NSString *const)clientSecret
presentationContextProvider:(nullable id<ASWebAuthenticationPresentationContextProviding>)presentationContextProvider
completion:(void (^)(NSString *_Nullable accessToken))completion API_AVAILABLE(ios(8.0));
/// Invoke this from your app delegate's implementation of -application:openURL:options:, returns whether or not the URL was a completion callback to Foursquare auth.
+ (BOOL)tryHandleAuthenticationCallbackWithURL:(NSURL *const)url API_AVAILABLE(ios(8.0));
+ (BOOL)isFoursquareAppAvailable;
@end
NS_ASSUME_NONNULL_END