-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updating project to latest Kinvey version
- Loading branch information
Victor Barros
committed
Mar 3, 2016
1 parent
9801fc3
commit 10b086c
Showing
188 changed files
with
13,068 additions
and
308 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// CLLocation+Kinvey.h | ||
// KinveyKit | ||
// | ||
// Copyright (c) 2012-2015 Kinvey. All rights reserved. | ||
// | ||
// This software is licensed to you under the Kinvey terms of service located at | ||
// http://www.kinvey.com/terms-of-use. By downloading, accessing and/or using this | ||
// software, you hereby accept such terms of service (and any agreement referenced | ||
// therein) and agree that you have read, understand and agree to be bound by such | ||
// terms of service and are of legal age to agree to such terms with Kinvey. | ||
// | ||
// This software contains valuable confidential and proprietary information of | ||
// KINVEY, INC and is subject to applicable licensing agreements. | ||
// Unauthorized reproduction, transmission or distribution of this file and its | ||
// contents is a violation of applicable laws. | ||
// | ||
|
||
#import <CoreLocation/CoreLocation.h> | ||
|
||
/** Convert a CLLocationCoordinate2D to the Kinvey representation; | ||
@since 1.26.0 | ||
*/ | ||
NSArray* CLLocationCoordinate2DToKCS(CLLocationCoordinate2D coordinate); | ||
|
||
/** Helper Category to allow for persisting CLLocation objects to the Kinvey backend. | ||
@since 1.8 | ||
*/ | ||
@interface CLLocation (Kinvey) | ||
/** Converts this CLLocation to a form persistable to Kinvey. | ||
This saves a array in the longitude, latitude format, which is backwards from most CoreLocation methods. The long, lat order is necessary for geo queries in Kinvey. | ||
@since 1.8 | ||
*/ | ||
- (NSArray*) kinveyValue; | ||
|
||
/** turns a serialized [longitude,latitude] array into a CLLocation object. | ||
@param kinveyValue an array object loaded from the backend. | ||
@return a new object represented by the array. | ||
@since 1.8 | ||
*/ | ||
+ (CLLocation*) locationFromKinveyValue:(NSArray*)kinveyValue; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
// | ||
// KCSAppdataStore.h | ||
// KinveyKit | ||
// | ||
// Copyright (c) 2012-2015 Kinvey, Inc. All rights reserved. | ||
// | ||
// This software is licensed to you under the Kinvey terms of service located at | ||
// http://www.kinvey.com/terms-of-use. By downloading, accessing and/or using this | ||
// software, you hereby accept such terms of service (and any agreement referenced | ||
// therein) and agree that you have read, understand and agree to be bound by such | ||
// terms of service and are of legal age to agree to such terms with Kinvey. | ||
// | ||
// This software contains valuable confidential and proprietary information of | ||
// KINVEY, INC and is subject to applicable licensing agreements. | ||
// Unauthorized reproduction, transmission or distribution of this file and its | ||
// contents is a violation of applicable laws. | ||
// | ||
|
||
#ifndef KinveyKit_KCSAppdataStore_h | ||
#define KinveyKit_KCSAppdataStore_h | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "KCSStore.h" | ||
#import "KCSBackgroundAppdataStore.h" | ||
|
||
@class KCSCollection; | ||
|
||
/** | ||
KCSStore options dictionary key for the backing resource | ||
*/ | ||
#define KCSStoreKeyResource @"resource" | ||
|
||
/** | ||
KCSStore options dictionary key for the backing collection name. This can be used instead of suppling a KCSStoreKeyResource. Use with KCSStoreKeyCollectionTemplateClass. | ||
@since 1.11.0 | ||
*/ | ||
#define KCSStoreKeyCollectionName @"collectionName" | ||
|
||
/** | ||
KCSStore options dictionary key for the backing collection object class. This can be used instead of suppling a KCSStoreKeyResource. Use with KCSStoreKeyCollectionName. If a KCSStoreKeyCollectionName is supplied, but no KCSStoreKeyCollectionTemplateClass, NSMutableDictionary will be used by default. | ||
@since 1.11.0 | ||
*/ | ||
#define KCSStoreKeyCollectionTemplateClass @"collectionClass" | ||
|
||
//internal key | ||
#define KCSStoreKeyOngoingProgress @"referenceprogress" | ||
#define KCSStoreKeyTitle @"storetitle" | ||
|
||
/** | ||
Basic Store for loading Application Data from a Collection in the Kinvey backend. | ||
The preferred use of this class is to use a KCSCachedStore with a `cachePolicy` of `KCSCachePolicyNone`. | ||
@see KCSCachedStore | ||
*/ | ||
@interface KCSAppdataStore : KCSBackgroundAppdataStore | ||
|
||
@property (nonatomic, strong) KCSAuthHandler *authHandler KCS_DEPRECATED(Auth handler not used, 1.22.0); | ||
|
||
|
||
/** Initialize an empty store with the given collections, options and the default authentication | ||
This will initialize an empty store with the given options and default authentication, | ||
the given options dictionary should be defined by the Kinvey Store that implements | ||
the protocol. | ||
@param collection the Kinvey backend Collection providing data to this store. | ||
@param options A dictionary of options to configure the store. (Can be nil if there are no options) | ||
@see [KCSStore storeWithOptions:] | ||
@return An autoreleased empty store with configured options and default authentication. | ||
*/ | ||
+ (instancetype) storeWithCollection:(KCSCollection*)collection options:(NSDictionary*)options; | ||
|
||
/** Initialize an empty store with the given options and the given authentication | ||
This will initialize an empty store with the given options and given authentication, | ||
the options dictionary should be defined by the Kinvey Store that implements | ||
the protocol. Authentication is Kinvey Store specific, refer to specific store's | ||
documentation for details. | ||
@param collection the Kinvey backend Collection providing data to this store. | ||
@param options A dictionary of options to configure the store. (Can be nil if there are no options) | ||
@param authHandler The Kinvey Authentication Handler used to authenticate backend requests. | ||
@return An autoreleased empty store with configured options and given authentication. | ||
@depcratedIn 1.22.0 | ||
@deprecated Use use storeWithCollection:options: instead | ||
*/ | ||
+ (instancetype)storeWithCollection:(KCSCollection*)collection authHandler:(KCSAuthHandler *)authHandler withOptions: (NSDictionary *)options KCS_DEPRECATED(Auth handler not used--use storeWithCollection:options: instead, 1.22.0); | ||
|
||
///--------------------------------------------------------------------------------------- | ||
/// @name Querying/Fetching | ||
///--------------------------------------------------------------------------------------- | ||
|
||
/** Load objects from the store with the given IDs. | ||
@param objectID this is an individual ID or an array of IDs to load | ||
@param completionBlock A block that gets invoked when all objects are loaded | ||
@param progressBlock A block that is invoked whenever the store can offer an update on the progress of the operation. | ||
@return KCSRequest object that represents the pending request made against the store. Since version 1.36.0 | ||
*/ | ||
-(KCSRequest*)loadObjectWithID:(id)objectID | ||
withCompletionBlock:(KCSCompletionBlock)completionBlock | ||
withProgressBlock:(KCSProgressBlock)progressBlock; | ||
|
||
/*! Aggregate objects in the store and apply a function to all members in that group. | ||
This method will find the objects in the store, collect them with other other objects that have the same value for the specified fields, and then apply the supplied function on those objects. Right now the types of functions that can be applied are simple mathematical operations. See KCSReduceFunction for more information on the types of functions available. | ||
@param fieldOrFields The array of fields to group by (or a single `NSString` field name). If multiple field names are supplied the groups will be made from objects that form the intersection of the field values. For instance, if you have two fields "a" and "b", and objects "{a:1,b:1},{a:1,b:1},{a:1,b:2},{a:2,b:2}" and apply the `COUNT` function, the returned KCSGroup object will have an array of 3 objects: "{a:1,b:1,count:2},{a:1,b:2,count:1},{a:2,b:2,count:1}". For objects that don't have a value for a given field, the value used will be `NSNull`. | ||
@param function This is the function that is applied to the items in the group. If you do not want to apply a function, just use queryWithQuery:withCompletionBlock:withProgressBlock: instead and query for items that match specific field values. | ||
@param completionBlock A block that is invoked when the grouping is complete, or an error occurs. | ||
@param progressBlock A block that is invoked whenever the store can offer an update on the progress of the operation. | ||
@return KCSRequest object that represents the pending request made against the store. Since version 1.36.0 | ||
@see group:reduce:condition:completionBlock:progressBlock: | ||
@see KCSGroup | ||
@see KCSReduceFunction | ||
*/ | ||
-(KCSRequest*)group:(id)fieldOrFields | ||
reduce:(KCSReduceFunction*)function | ||
completionBlock:(KCSGroupCompletionBlock)completionBlock | ||
progressBlock:(KCSProgressBlock)progressBlock; | ||
|
||
/*! Aggregate objects in the store and apply a function to all members in that group that satisfy the condition. | ||
This method will find the objects in the store, collect them with other other objects that have the same value for the specified fields, and then apply the supplied function on those objects. Right now the types of functions that can be applied are simple mathematical operations. See KCSReduceFunction for more information on the types of functions available. | ||
@param fieldOrFields The array of fields to group by (or a single `NSString` field name). If multiple field names are supplied the groups will be made from objects that form the intersection of the field values. For instance, if you have two fields "a" and "b", and objects "{a:1,b:1},{a:1,b:1},{a:1,b:2},{a:2,b:2}" and apply the `COUNT` function, the returned KCSGroup object will have an array of 3 objects: "{a:1,b:1,count:2},{a:1,b:2,count:1},{a:2,b:2,count:1}". For objects that don't have a value for a given field, the value used will be `NSNull`. | ||
@param function This is the function that is applied to the items in the group. If you do not want to apply a function, just use queryWithQuery:withCompletionBlock:withProgressBlock: instead and query for items that match specific field values. | ||
@param condition This is a KCSQuery object that is used to filter the objects before grouping. Only groupings with at least one object that matches the condition will appear in the resultant KCSGroup object. __The group function does not support sorting, limit, or skip modifiers__. | ||
@param completionBlock A block that is invoked when the grouping is complete, or an error occurs. | ||
@param progressBlock A block that is invoked whenever the store can offer an update on the progress of the operation. | ||
@return KCSRequest object that represents the pending request made against the store. Since version 1.36.0 | ||
@see group:reduce:completionBlock:progressBlock: | ||
@see KCSGroup | ||
@see KCSReduceFunction | ||
*/ | ||
-(KCSRequest*)group:(id)fieldOrFields | ||
reduce:(KCSReduceFunction*)function | ||
condition:(KCSQuery*)condition | ||
completionBlock:(KCSGroupCompletionBlock)completionBlock | ||
progressBlock:(KCSProgressBlock)progressBlock; | ||
|
||
#pragma mark - Information | ||
/** Count all the elements the collection | ||
@param countBlock the block that receives the response | ||
@return KCSRequest object that represents the pending request made against the store. Since version 1.36.0 | ||
@see countWithQuery:completion: | ||
*/ | ||
-(KCSRequest*)countWithBlock:(KCSCountBlock)countBlock; | ||
|
||
/** Count all the elements the collection that match a given query. | ||
This method is useful for finding out how big a query will be without transferring all the data. This method is __not__ cached. | ||
@param query the query to filter the elements | ||
@param countBlock the block that receives the response | ||
@return KCSRequest object that represents the pending request made against the store. Since version 1.36.0 | ||
@since 1.15.0 | ||
*/ | ||
-(KCSRequest*)countWithQuery:(KCSQuery*)query | ||
completion:(KCSCountBlock)countBlock; | ||
|
||
@end | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// KCSAuthCredential.h | ||
// KinveyKit | ||
// | ||
// Copyright (c) 2012-2015 Kinvey. All rights reserved. | ||
// | ||
// This software is licensed to you under the Kinvey terms of service located at | ||
// http://www.kinvey.com/terms-of-use. By downloading, accessing and/or using this | ||
// software, you hereby accept such terms of service (and any agreement referenced | ||
// therein) and agree that you have read, understand and agree to be bound by such | ||
// terms of service and are of legal age to agree to such terms with Kinvey. | ||
// | ||
// This software contains valuable confidential and proprietary information of | ||
// KINVEY, INC and is subject to applicable licensing agreements. | ||
// Unauthorized reproduction, transmission or distribution of this file and its | ||
// contents is a violation of applicable laws. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "KCSCredentials.h" | ||
|
||
@interface KCSAuthCredential : NSObject | ||
|
||
+ (instancetype)credentialForURL: (NSString *)URL usingMethod: (NSInteger)method; | ||
- (id<KCSCredentials>)credentials; | ||
- (BOOL)requiresAuthentication; | ||
|
||
@end |
66 changes: 66 additions & 0 deletions
66
Kinvey/KinveyKit.framework/Headers/KCSBackgroundAppdataStore.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// | ||
// KCSBackgroundAppdataStore.h | ||
// KinveyKit | ||
// | ||
// Copyright (c) 2015 Kinvey. All rights reserved. | ||
// | ||
// This software is licensed to you under the Kinvey terms of service located at | ||
// http://www.kinvey.com/terms-of-use. By downloading, accessing and/or using this | ||
// software, you hereby accept such terms of service (and any agreement referenced | ||
// therein) and agree that you have read, understand and agree to be bound by such | ||
// terms of service and are of legal age to agree to such terms with Kinvey. | ||
// | ||
// This software contains valuable confidential and proprietary information of | ||
// KINVEY, INC and is subject to applicable licensing agreements. | ||
// Unauthorized reproduction, transmission or distribution of this file and its | ||
// contents is a violation of applicable laws. | ||
// | ||
|
||
#ifndef KinveyKit_KCSBackgroundAppdataStore_h | ||
#define KinveyKit_KCSBackgroundAppdataStore_h | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#import "KCSStore.h" | ||
#import "KCSRequest.h" | ||
#import "KCSCacheUpdatePolicy.h" | ||
|
||
@class KCSCollection; | ||
@interface KCSBackgroundAppdataStore : NSObject <KCSStore> | ||
|
||
@property (nonatomic, strong) KCSAuthHandler *authHandler KCS_DEPRECATED(Auth handler not used, 1.22.0); | ||
|
||
/** | ||
Enable delta set caching for this store. This optimize the time to retrieve objects from the server since it will only return the delta between the local cache and the Kinvey server. | ||
*/ | ||
@property (nonatomic) KCSCacheUpdatePolicy cacheUpdatePolicy; | ||
|
||
|
||
+ (instancetype) storeWithCollection:(KCSCollection*)collection options:(NSDictionary*)options; | ||
|
||
+ (instancetype)storeWithCollection:(KCSCollection*)collection authHandler:(KCSAuthHandler *)authHandler withOptions: (NSDictionary *)options KCS_DEPRECATED(Auth handler not used--use storeWithCollection:options: instead, 1.22.0); | ||
|
||
-(KCSRequest*)loadObjectWithID:(id)objectID | ||
withCompletionBlock:(KCSCompletionBlock)completionBlock | ||
withProgressBlock:(KCSProgressBlock)progressBlock; | ||
|
||
-(KCSRequest*)group:(id)fieldOrFields | ||
reduce:(KCSReduceFunction*)function | ||
completionBlock:(KCSGroupCompletionBlock)completionBlock | ||
progressBlock:(KCSProgressBlock)progressBlock; | ||
|
||
-(KCSRequest*)group:(id)fieldOrFields | ||
reduce:(KCSReduceFunction*)function | ||
condition:(KCSQuery*)condition | ||
completionBlock:(KCSGroupCompletionBlock)completionBlock | ||
progressBlock:(KCSProgressBlock)progressBlock; | ||
|
||
#pragma mark - Information | ||
-(KCSRequest*)countWithBlock:(KCSCountBlock)countBlock; | ||
|
||
-(KCSRequest*)countWithQuery:(KCSQuery*)query | ||
completion:(KCSCountBlock)countBlock; | ||
|
||
@end | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// KCSBase64.h | ||
// KinveyKit | ||
// | ||
// Copyright (c) 2015 Kinvey. All rights reserved. | ||
// | ||
// This software is licensed to you under the Kinvey terms of service located at | ||
// http://www.kinvey.com/terms-of-use. By downloading, accessing and/or using this | ||
// software, you hereby accept such terms of service (and any agreement referenced | ||
// therein) and agree that you have read, understand and agree to be bound by such | ||
// terms of service and are of legal age to agree to such terms with Kinvey. | ||
// | ||
// This software contains valuable confidential and proprietary information of | ||
// KINVEY, INC and is subject to applicable licensing agreements. | ||
// Unauthorized reproduction, transmission or distribution of this file and its | ||
// contents is a violation of applicable laws. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
NSString *KCSbasicAuthString(NSString *username, NSString *password); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// KCSBlockDefs.h | ||
// KinveyKit | ||
// | ||
// Created by Brian Wilson on 5/2/12. | ||
// Copyright (c) 2012-2015 Kinvey. All rights reserved. | ||
// | ||
// This software is licensed to you under the Kinvey terms of service located at | ||
// http://www.kinvey.com/terms-of-use. By downloading, accessing and/or using this | ||
// software, you hereby accept such terms of service (and any agreement referenced | ||
// therein) and agree that you have read, understand and agree to be bound by such | ||
// terms of service and are of legal age to agree to such terms with Kinvey. | ||
// | ||
// This software contains valuable confidential and proprietary information of | ||
// KINVEY, INC and is subject to applicable licensing agreements. | ||
// Unauthorized reproduction, transmission or distribution of this file and its | ||
// contents is a violation of applicable laws. | ||
// | ||
|
||
#ifndef KinveyKit_KCSBlockDefs_h | ||
#define KinveyKit_KCSBlockDefs_h | ||
|
||
#import "KCSUserActionResult.h" | ||
|
||
@class KCSUser; | ||
@class KCSGroup; | ||
|
||
typedef void(^KCSCompletionBlock)(NSArray *objectsOrNil, NSError *errorOrNil); | ||
|
||
/*! A progress block. | ||
@param objects if there are any valid objects available. Could be `nil` or empty. | ||
@param percentComplete the percentage of the total progress made so far. Suitable for a progress indicator. | ||
*/ | ||
typedef void(^KCSProgressBlock)(NSArray *objects, double percentComplete); | ||
|
||
/*! A completion block where the result is a coumt. | ||
@param count the resulting count of the operation | ||
@param errorOrNil an non-nil object if an error occurred. | ||
*/ | ||
typedef void (^KCSCountBlock) (unsigned long count, NSError *errorOrNil); | ||
typedef void (^KCSDeletionBlock) (NSDictionary* deletionDictOrNil, NSError* errorOrNil); | ||
|
||
typedef void(^KCSGroupCompletionBlock)(KCSGroup* valuesOrNil, NSError* errorOrNil); | ||
|
||
typedef void(^KCSSuccessBlock)(BOOL success, NSError* error); | ||
|
||
typedef void (^KCSUserCompletionBlock)(KCSUser* user, NSError* errorOrNil, KCSUserActionResult result); | ||
typedef void (^KCSUserSendEmailBlock)(BOOL emailSent, NSError* errorOrNil); | ||
typedef void (^KCSUserCheckUsernameBlock)(NSString* username, BOOL usernameAlreadyTaken, NSError* error); | ||
|
||
/** Completion block for `getAccessDictionaryFromTwitterFromPrimaryAccount:` returns either the access dictionary to pass to `+[KCSUser loginWithWithSocialIdentity:accessDictionary:withCompletionBlock]` or an error. | ||
*/ | ||
typedef void (^KCSLocalCredentialBlock)(NSDictionary* accessDictOrNil, NSError* errorOrNil); | ||
|
||
typedef void (^KCSCustomEndpointBlock)(id results, NSError* error); | ||
|
||
#endif |
Oops, something went wrong.