commit | author | age
|
bad748
|
1 |
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
W |
2 |
// |
|
3 |
// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
|
4 |
// copy, modify, and distribute this software in source code or binary form for use |
|
5 |
// in connection with the web services and APIs provided by Facebook. |
|
6 |
// |
|
7 |
// As with any software that integrates with the Facebook platform, your use of |
|
8 |
// this software is subject to the Facebook Developer Principles and Policies |
|
9 |
// [http://developers.facebook.com/policy/]. This copyright notice shall be |
|
10 |
// included in all copies or substantial portions of the software. |
|
11 |
// |
|
12 |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
13 |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
|
14 |
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
|
15 |
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
|
16 |
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
|
17 |
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
18 |
|
|
19 |
#import <Foundation/Foundation.h> |
|
20 |
|
9febd9
|
21 |
/** |
W |
22 |
Class to contain common utility methods. |
bad748
|
23 |
*/ |
W |
24 |
@interface FBSDKUtility : NSObject |
|
25 |
|
13e53a
|
26 |
- (instancetype)init NS_UNAVAILABLE; |
H |
27 |
+ (instancetype)new NS_UNAVAILABLE; |
|
28 |
|
9febd9
|
29 |
/** |
W |
30 |
Parses a query string into a dictionary. |
13e53a
|
31 |
@param queryString The query string value. |
H |
32 |
@return A dictionary with the key/value pairs. |
bad748
|
33 |
*/ |
W |
34 |
+ (NSDictionary *)dictionaryWithQueryString:(NSString *)queryString; |
|
35 |
|
9febd9
|
36 |
/** |
W |
37 |
Constructs a query string from a dictionary. |
13e53a
|
38 |
@param dictionary The dictionary with key/value pairs for the query string. |
H |
39 |
@param errorRef If an error occurs, upon return contains an NSError object that describes the problem. |
|
40 |
@return Query string representation of the parameters. |
bad748
|
41 |
*/ |
W |
42 |
+ (NSString *)queryStringWithDictionary:(NSDictionary *)dictionary error:(NSError *__autoreleasing *)errorRef; |
|
43 |
|
9febd9
|
44 |
/** |
W |
45 |
Decodes a value from an URL. |
13e53a
|
46 |
@param value The value to decode. |
H |
47 |
@return The decoded value. |
bad748
|
48 |
*/ |
W |
49 |
+ (NSString *)URLDecode:(NSString *)value; |
|
50 |
|
9febd9
|
51 |
/** |
W |
52 |
Encodes a value for an URL. |
13e53a
|
53 |
@param value The value to encode. |
H |
54 |
@return The encoded value. |
bad748
|
55 |
*/ |
W |
56 |
+ (NSString *)URLEncode:(NSString *)value; |
|
57 |
|
9f077b
|
58 |
/** |
H |
59 |
Creates a timer using Grand Central Dispatch. |
13e53a
|
60 |
@param interval The interval to fire the timer, in seconds. |
H |
61 |
@param block The code block to execute when timer is fired. |
|
62 |
@return The dispatch handle. |
9f077b
|
63 |
*/ |
H |
64 |
+ (dispatch_source_t)startGCDTimerWithInterval:(double)interval block:(dispatch_block_t)block; |
|
65 |
|
|
66 |
/** |
|
67 |
Stop a timer that was started by startGCDTimerWithInterval. |
13e53a
|
68 |
@param timer The dispatch handle received from startGCDTimerWithInterval. |
9f077b
|
69 |
*/ |
H |
70 |
+ (void)stopGCDTimer:(dispatch_source_t)timer; |
|
71 |
|
13e53a
|
72 |
/** |
H |
73 |
Get SHA256 hased string of NSString/NSData |
|
74 |
|
|
75 |
@param input The data that needs to be hashed, it could be NSString or NSData. |
|
76 |
*/ |
|
77 |
+ (NSString *)SHA256Hash:(NSObject *)input; |
|
78 |
|
bad748
|
79 |
@end |