Merge branch 'develop' into 'master'
- ADD OAuth2 Manager See merge request !11
This commit is contained in:
commit
00fd4d3748
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="whP-gf-Uak">
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="whP-gf-Uak">
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="iOS"/>
|
<deployment identifier="iOS"/>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<scenes>
|
<scenes>
|
||||||
<!--Object View Controller-->
|
<!--Object View Controller-->
|
||||||
|
|||||||
@ -1,130 +1,143 @@
|
|||||||
//
|
//
|
||||||
// PNObjectAppDelegate.m
|
// PNObjectAppDelegate.m
|
||||||
// PNObject
|
// PNObject
|
||||||
//
|
//
|
||||||
// Created by Giuseppe Nucifora on 12/28/2015.
|
// Created by Giuseppe Nucifora on 12/28/2015.
|
||||||
// Copyright (c) 2015 Giuseppe Nucifora. All rights reserved.
|
// Copyright (c) 2015 Giuseppe Nucifora. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "PNObjectAppDelegate.h"
|
#import "PNObjectAppDelegate.h"
|
||||||
#import "PNObject.h"
|
#import "PNObject.h"
|
||||||
#import "PNUser.h"
|
#import "PNUser.h"
|
||||||
#import "PNAddress.h"
|
#import "PNAddress.h"
|
||||||
|
#import "PNObject+PNObjectConnection.h"
|
||||||
|
|
||||||
@implementation PNObjectAppDelegate
|
@implementation PNObjectAppDelegate
|
||||||
|
|
||||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||||
{
|
{
|
||||||
// Override point for customization after application launch.
|
// Override point for customization after application launch.
|
||||||
[PNObjectConfig initSharedInstanceForEnvironments:@{ EnvironmentDevelopment : @"https://development.it/api/v1",
|
|
||||||
EnvironmentStage : @"https://stage.it/api/v1",
|
|
||||||
EnvironmentProduction : @"https://pnobject.giuseppenucifora.com/"
|
[PNObjectConfig initSharedInstanceForEnvironments:@{EnvironmentDevelopment : @"http://packman.local/app_dev.php/api/v1/",
|
||||||
}];
|
EnvironmentStage : @"http://packman.ppreview.it/app_stage.php/api/v1/",
|
||||||
|
EnvironmentProduction : @"http://packman.ppreview.it/app_stage.php/api/v1/"
|
||||||
[[PNObjectConfig sharedInstance] setEnvironment:Production];
|
} withOauth:YES];
|
||||||
//[[[PNObjectConfig sharedInstance] manager] setSecurityPolicy:[AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate]];
|
[[PNObjectConfig sharedInstance] setHTTPHeaderValue:@"application/x-www-form-urlencoded" forKey:@"Content-Type"];
|
||||||
//[[PNObjectConfig sharedInstance] manager].securityPolicy.allowInvalidCertificates = YES;
|
[[PNObjectConfig sharedInstance] setClientID:@"1_pqjo2w5k7j4g8skco408oc048w8so0ws840gcg8k8gwsgk0g4" clientSecret:@"10w0vg2v6eggooc4wks4w4s0wkwok0wkck0w888so0o80g88w8" forEnv:Stage];
|
||||||
|
#ifdef DEBUG
|
||||||
//[PNObject get];*/
|
|
||||||
/*
|
[[PNObjectConfig sharedInstance] setEnvironment:Stage];
|
||||||
PNUser *user = [PNUser currentUser];
|
|
||||||
|
#endif
|
||||||
//NSLog(@"user : %@",[user getJSONObject]);
|
|
||||||
|
/*[PNObjectConfig initSharedInstanceForEnvironments:@{ EnvironmentDevelopment : @"https://development.it/api/v1",
|
||||||
//[user autoRemoveLocally];
|
EnvironmentStage : @"https://stage.it/api/v1",
|
||||||
[user setFirstName:@"Giuseppe2"];
|
EnvironmentProduction : @"https://pnobject.giuseppenucifora.com/"
|
||||||
[user setLastName:@"Nucifora2"];
|
}];
|
||||||
[user setEmail:@"giuseppe.nucifora@giuseppenucifora.com"];
|
|
||||||
[user setSex:@"M"];
|
[[PNObjectConfig sharedInstance] setEnvironment:Production];
|
||||||
[user setHasAcceptedNewsletter:NO];
|
|
||||||
[user setHasAcceptedPrivacy:YES];
|
//[[[PNObjectConfig sharedInstance] manager] setSecurityPolicy:[AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate]];
|
||||||
[user setUsername:@"giuseppe.nucifora"];
|
//[[PNObjectConfig sharedInstance] manager].securityPolicy.allowInvalidCertificates = YES;
|
||||||
[user setPassword:@"giuseppe.nucifora.password"];
|
|
||||||
[user setPhone:@"+393485904995"];
|
//[PNObject get];
|
||||||
[user setUserId:@"blablabla"];
|
|
||||||
[user saveLocally];
|
PNUser *user = [PNUser currentUser];
|
||||||
|
|
||||||
|
//NSLog(@"user : %@",[user getJSONObject]);
|
||||||
|
|
||||||
[user setFirstName:@"Angela"];
|
//[user autoRemoveLocally];
|
||||||
[user setLastName:@"Sapienza"];
|
[user setFirstName:@"Giuseppe2"];
|
||||||
|
[user setLastName:@"Nucifora2"];
|
||||||
[user getJSONObject];*/
|
[user setEmail:@"giuseppe.nucifora@giuseppenucifora.com"];
|
||||||
|
[user setSex:@"M"];
|
||||||
PNAccessToken *accessToken = [PNAccessToken currentAccessToken];
|
[user setHasAcceptedNewsletter:NO];
|
||||||
|
[user setHasAcceptedPrivacy:YES];
|
||||||
NSLog(@"%@",[accessToken JSONObject]);
|
[user setUsername:@"giuseppe.nucifora"];
|
||||||
|
[user setPassword:@"giuseppe.nucifora.password"];
|
||||||
|
[user setPhone:@"+393485904995"];
|
||||||
[[[PNObjectConfig sharedInstance] manager] GET:[[[PNObjectConfig sharedInstance] PNObjEndpoint] stringByAppendingString:[PNAccessToken PNObjClassName]] parameters:nil progress:^(NSProgress * _Nonnull downloadProgress) {
|
[user setUserId:@"blablabla"];
|
||||||
|
[user saveLocally];
|
||||||
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
|
||||||
|
|
||||||
PNAccessToken *accessToken = [[PNAccessToken alloc] initWithJSON:responseObject];
|
|
||||||
|
[user setFirstName:@"Angela"];
|
||||||
NSLog(@"%@",[accessToken JSONObject]);
|
[user setLastName:@"Sapienza"];
|
||||||
|
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
[user getJSONObject];*/
|
||||||
[accessToken saveLocally];
|
|
||||||
});
|
|
||||||
//[accessToken saveLocally];
|
/*[[[PNObjectConfig sharedInstance] manager] GET:[[[PNObjectConfig sharedInstance] baseUrl] stringByAppendingString:[PNAccessToken PNObjEndPoint]] parameters:nil progress:^(NSProgress * _Nonnull downloadProgress) {
|
||||||
|
|
||||||
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||||
|
|
||||||
NSLog(@"%@",error);
|
PNAccessToken *accessToken = [[PNAccessToken alloc] initWithJSON:responseObject];
|
||||||
|
|
||||||
}];
|
NSLog(@"%@",[accessToken JSONObject]);
|
||||||
//NSLog(@"%@",userDictionary);
|
|
||||||
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||||
/*
|
[accessToken saveLocally];
|
||||||
|
});
|
||||||
|
//[accessToken saveLocally];
|
||||||
PNAddress *address1 = [[PNAddress alloc] init];
|
|
||||||
[address1 setZip:@"95014"];
|
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
||||||
[address1 setCountry:@"Italy"];
|
|
||||||
[address1 setCity:@"Giarre"];
|
NSLog(@"%@",error);
|
||||||
[address1 setProvince:@"Catania"];
|
|
||||||
|
}];*/
|
||||||
NSLog(@"%@",[address1 saveLocally]);
|
|
||||||
|
//NSLog(@"%@",userDictionary);
|
||||||
|
|
||||||
PNAddress *address2 = [[PNAddress alloc] init];
|
/*
|
||||||
[address2 setZip:@"95014"];
|
|
||||||
[address2 setCountry:@"Italy"];
|
|
||||||
[address2 setCity:@"Giarre"];
|
PNAddress *address1 = [[PNAddress alloc] init];
|
||||||
[address2 setProvince:@"Catania"];
|
[address1 setZip:@"95014"];
|
||||||
|
[address1 setCountry:@"Italy"];
|
||||||
NSLog(@"%@",[address2 saveLocally]);*/
|
[address1 setCity:@"Giarre"];
|
||||||
|
[address1 setProvince:@"Catania"];
|
||||||
|
|
||||||
return YES;
|
NSLog(@"%@",[address1 saveLocally]);
|
||||||
|
|
||||||
|
|
||||||
|
PNAddress *address2 = [[PNAddress alloc] init];
|
||||||
|
[address2 setZip:@"95014"];
|
||||||
|
[address2 setCountry:@"Italy"];
|
||||||
|
[address2 setCity:@"Giarre"];
|
||||||
|
[address2 setProvince:@"Catania"];
|
||||||
|
|
||||||
|
NSLog(@"%@",[address2 saveLocally]);*/
|
||||||
|
|
||||||
|
|
||||||
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationWillResignActive:(UIApplication *)application
|
- (void)applicationWillResignActive:(UIApplication *)application
|
||||||
{
|
{
|
||||||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||||
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationDidEnterBackground:(UIApplication *)application
|
- (void)applicationDidEnterBackground:(UIApplication *)application
|
||||||
{
|
{
|
||||||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationWillEnterForeground:(UIApplication *)application
|
- (void)applicationWillEnterForeground:(UIApplication *)application
|
||||||
{
|
{
|
||||||
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationDidBecomeActive:(UIApplication *)application
|
- (void)applicationDidBecomeActive:(UIApplication *)application
|
||||||
{
|
{
|
||||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationWillTerminate:(UIApplication *)application
|
- (void)applicationWillTerminate:(UIApplication *)application
|
||||||
{
|
{
|
||||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
int main(int argc, char * argv[])
|
int main(int argc, char * argv[])
|
||||||
{
|
{
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([PNObjectAppDelegate class]));
|
return UIApplicationMain(argc, argv, nil, NSStringFromClass([PNObjectAppDelegate class]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,8 @@ target 'PNObject_Example' do
|
|||||||
pod 'NSString-Helper'
|
pod 'NSString-Helper'
|
||||||
pod 'CodFis-Helper'
|
pod 'CodFis-Helper'
|
||||||
pod 'StrongestPasswordValidator'
|
pod 'StrongestPasswordValidator'
|
||||||
|
pod 'AFOAuth2Manager', :git => 'https://github.com/AFNetworking/AFOAuth2Manager.git', :branch => '3_0_0_branch'
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
target 'PNObject_Tests' do
|
target 'PNObject_Tests' do
|
||||||
|
|||||||
@ -14,6 +14,8 @@ PODS:
|
|||||||
- AFNetworking/Serialization (3.0.4)
|
- AFNetworking/Serialization (3.0.4)
|
||||||
- AFNetworking/UIKit (3.0.4):
|
- AFNetworking/UIKit (3.0.4):
|
||||||
- AFNetworking/NSURLSession
|
- AFNetworking/NSURLSession
|
||||||
|
- AFOAuth2Manager (3.0.0):
|
||||||
|
- AFNetworking/NSURLSession (~> 3.0)
|
||||||
- CodFis-Helper (0.1.2)
|
- CodFis-Helper (0.1.2)
|
||||||
- Expecta (1.0.5)
|
- Expecta (1.0.5)
|
||||||
- Expecta+Snapshots (2.0.0):
|
- Expecta+Snapshots (2.0.0):
|
||||||
@ -28,7 +30,7 @@ PODS:
|
|||||||
- NSString-Helper (1.0.2)
|
- NSString-Helper (1.0.2)
|
||||||
- nv-ios-http-status (0.0.1)
|
- nv-ios-http-status (0.0.1)
|
||||||
- PEAR-FileManager-iOS (1.3.1)
|
- PEAR-FileManager-iOS (1.3.1)
|
||||||
- PNObject (0.2.3):
|
- PNObject (0.2.5):
|
||||||
- AFNetworking
|
- AFNetworking
|
||||||
- CodFis-Helper
|
- CodFis-Helper
|
||||||
- NSDate_Utils
|
- NSDate_Utils
|
||||||
@ -42,6 +44,7 @@ PODS:
|
|||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- AFNetworking
|
- AFNetworking
|
||||||
|
- AFOAuth2Manager (from `https://github.com/AFNetworking/AFOAuth2Manager.git`, branch `3_0_0_branch`)
|
||||||
- CodFis-Helper
|
- CodFis-Helper
|
||||||
- Expecta
|
- Expecta
|
||||||
- Expecta+Snapshots
|
- Expecta+Snapshots
|
||||||
@ -56,11 +59,20 @@ DEPENDENCIES:
|
|||||||
- UIDevice-Utils
|
- UIDevice-Utils
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
|
AFOAuth2Manager:
|
||||||
|
:branch: 3_0_0_branch
|
||||||
|
:git: https://github.com/AFNetworking/AFOAuth2Manager.git
|
||||||
PNObject:
|
PNObject:
|
||||||
:path: "../"
|
:path: "../"
|
||||||
|
|
||||||
|
CHECKOUT OPTIONS:
|
||||||
|
AFOAuth2Manager:
|
||||||
|
:commit: b2c665b1d354ed322517cbfed004ec210c193200
|
||||||
|
:git: https://github.com/AFNetworking/AFOAuth2Manager.git
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
AFNetworking: a0075feb321559dc78d9d85b55d11caa19eabb93
|
AFNetworking: a0075feb321559dc78d9d85b55d11caa19eabb93
|
||||||
|
AFOAuth2Manager: 0566da1be64883e339813d411229fdc9a84dab7c
|
||||||
CodFis-Helper: f303810699f22dbcba8fb8c600545ac91fc3ec42
|
CodFis-Helper: f303810699f22dbcba8fb8c600545ac91fc3ec42
|
||||||
Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe
|
Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe
|
||||||
Expecta+Snapshots: 29b38dd695bc72a0ed2bea833937d78df41943ba
|
Expecta+Snapshots: 29b38dd695bc72a0ed2bea833937d78df41943ba
|
||||||
@ -69,11 +81,11 @@ SPEC CHECKSUMS:
|
|||||||
NSString-Helper: 0ee74919829a332f9838fa87b28cb2d1d991e92c
|
NSString-Helper: 0ee74919829a332f9838fa87b28cb2d1d991e92c
|
||||||
nv-ios-http-status: b6c2b5fc8656cc19e0d3000dadce2080b99d0e2f
|
nv-ios-http-status: b6c2b5fc8656cc19e0d3000dadce2080b99d0e2f
|
||||||
PEAR-FileManager-iOS: 3bc403f68a53483f5629aa822f4649e40275c4d3
|
PEAR-FileManager-iOS: 3bc403f68a53483f5629aa822f4649e40275c4d3
|
||||||
PNObject: 7bd9bb008740ecb0d8e5a8ab58606a4eb4d10132
|
PNObject: 7b3ba081925d7350724b7d6204b89c09a16dd6bf
|
||||||
Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2
|
Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2
|
||||||
StrongestPasswordValidator: 554de9038705e18904f0337903dfd3b85a6b271b
|
StrongestPasswordValidator: 554de9038705e18904f0337903dfd3b85a6b271b
|
||||||
UIDevice-Utils: 0beb5f9d2bd256a3efe05c1e43a2a8b8702199c4
|
UIDevice-Utils: 0beb5f9d2bd256a3efe05c1e43a2a8b8702199c4
|
||||||
|
|
||||||
PODFILE CHECKSUM: 3d7d9ec922a37131d59224a7700af30168ea90b1
|
PODFILE CHECKSUM: 37a34cf275bf360e24441736dd77a0f74d9fb210
|
||||||
|
|
||||||
COCOAPODS: 1.0.0.beta.2
|
COCOAPODS: 1.0.0.beta.3
|
||||||
|
|||||||
36
Example/Pods/AFOAuth2Manager/AFOAuth2Manager/AFHTTPRequestSerializer+OAuth2.h
generated
Normal file
36
Example/Pods/AFOAuth2Manager/AFOAuth2Manager/AFHTTPRequestSerializer+OAuth2.h
generated
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
// AFHTTPRequestSerializer+OAuth2.h
|
||||||
|
//
|
||||||
|
// Copyright (c) 2012-2014 AFNetworking (http://afnetworking.com)
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
// in the Software without restriction, including without limitation the rights
|
||||||
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
// furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in
|
||||||
|
// all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
// THE SOFTWARE.
|
||||||
|
|
||||||
|
#import <AFNetworking/AFURLRequestSerialization.h>
|
||||||
|
|
||||||
|
@class AFOAuthCredential;
|
||||||
|
|
||||||
|
@interface AFHTTPRequestSerializer (OAuth2)
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sets the "Authorization" HTTP header set in request objects made by the HTTP client to contain the access token within the OAuth credential. This overwrites any existing value for this header.
|
||||||
|
|
||||||
|
@param credential The OAuth2 credential
|
||||||
|
*/
|
||||||
|
- (void)setAuthorizationHeaderFieldWithCredential:(AFOAuthCredential *)credential;
|
||||||
|
|
||||||
|
@end
|
||||||
35
Example/Pods/AFOAuth2Manager/AFOAuth2Manager/AFHTTPRequestSerializer+OAuth2.m
generated
Normal file
35
Example/Pods/AFOAuth2Manager/AFOAuth2Manager/AFHTTPRequestSerializer+OAuth2.m
generated
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
// AFHTTPRequestSerializer+OAuth2.m
|
||||||
|
//
|
||||||
|
// Copyright (c) 2012-2014 AFNetworking (http://afnetworking.com)
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
// in the Software without restriction, including without limitation the rights
|
||||||
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
// furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in
|
||||||
|
// all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
// THE SOFTWARE.
|
||||||
|
|
||||||
|
#import "AFHTTPRequestSerializer+OAuth2.h"
|
||||||
|
#import "AFOAuth2Manager.h"
|
||||||
|
#import "AFOAuthCredential.h"
|
||||||
|
|
||||||
|
@implementation AFHTTPRequestSerializer (OAuth2)
|
||||||
|
|
||||||
|
- (void)setAuthorizationHeaderFieldWithCredential:(AFOAuthCredential *)credential {
|
||||||
|
if ([credential.tokenType compare:@"Bearer" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
|
||||||
|
[self setValue:[NSString stringWithFormat:@"Bearer %@", credential.accessToken] forHTTPHeaderField:@"Authorization"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
192
Example/Pods/AFOAuth2Manager/AFOAuth2Manager/AFOAuth2Manager.h
generated
Normal file
192
Example/Pods/AFOAuth2Manager/AFOAuth2Manager/AFOAuth2Manager.h
generated
Normal file
@ -0,0 +1,192 @@
|
|||||||
|
// AFOAuth2Manager.h
|
||||||
|
//
|
||||||
|
// Copyright (c) 2012-2014 AFNetworking (http://afnetworking.com)
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
// in the Software without restriction, including without limitation the rights
|
||||||
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
// furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in
|
||||||
|
// all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
// THE SOFTWARE
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import "AFOAuthCredential.h"
|
||||||
|
#import "AFHTTPRequestSerializer+OAuth2.h"
|
||||||
|
|
||||||
|
@import AFNetworking;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface AFOAuth2Manager : AFHTTPSessionManager
|
||||||
|
|
||||||
|
///------------------------------------------
|
||||||
|
/// @name Accessing OAuth 2 Client Properties
|
||||||
|
///------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
The service provider identifier used to store and retrieve OAuth credentials by `AFOAuthCredential`. Equivalent to the hostname of the client `baseURL`.
|
||||||
|
*/
|
||||||
|
@property (readonly, nonatomic, copy) NSString *serviceProviderIdentifier;
|
||||||
|
|
||||||
|
/**
|
||||||
|
The client identifier issued by the authorization server, uniquely representing the registration information provided by the client.
|
||||||
|
*/
|
||||||
|
@property (readonly, nonatomic, copy) NSString *clientID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Whether to encode client credentials in a Base64-encoded HTTP `Authorization` header, as opposed to the request body. Defaults to `YES`.
|
||||||
|
*/
|
||||||
|
@property (nonatomic, assign) BOOL useHTTPBasicAuthentication;
|
||||||
|
|
||||||
|
///------------------------------------------------
|
||||||
|
/// @name Creating and Initializing OAuth 2 Managers
|
||||||
|
///------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
Creates and initializes an `AFOAuth2Manager` object with the specified base URL, client identifier, and secret.
|
||||||
|
|
||||||
|
@param url The base URL for the HTTP client. This argument must not be `nil`.
|
||||||
|
@param clientID The client identifier issued by the authorization server, uniquely representing the registration information provided by the client. This argument must not be `nil`.
|
||||||
|
@param secret The client secret.
|
||||||
|
|
||||||
|
@return The newly-initialized OAuth 2 manager
|
||||||
|
*/
|
||||||
|
+ (instancetype)managerWithBaseURL:(NSURL *)url
|
||||||
|
clientID:(NSString *)clientID
|
||||||
|
secret:(NSString *)secret;
|
||||||
|
|
||||||
|
+ (instancetype)managerWithBaseURL:(NSURL *)url
|
||||||
|
sessionConfiguration:(nullable NSURLSessionConfiguration *)configuration
|
||||||
|
clientID:(NSString *)clientID
|
||||||
|
secret:(NSString *)secret;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Initializes an `AFOAuth2Manager` object with the specified base URL, client identifier, and secret. The communication to to the server will use HTTP basic auth by default (use `-(id)initWithBaseURL:clientID:secret:withBasicAuth:` to change this).
|
||||||
|
|
||||||
|
@param url The base URL for the HTTP manager. This argument must not be `nil`.
|
||||||
|
@param clientID The client identifier issued by the authorization server, uniquely representing the registration information provided by the client. This argument must not be `nil`.
|
||||||
|
@param secret The client secret.
|
||||||
|
|
||||||
|
@return The newly-initialized OAuth 2 client
|
||||||
|
*/
|
||||||
|
- (id)initWithBaseURL:(NSURL *)url
|
||||||
|
clientID:(NSString *)clientID
|
||||||
|
secret:(NSString *)secret;
|
||||||
|
|
||||||
|
- (id)initWithBaseURL:(NSURL *)url
|
||||||
|
sessionConfiguration:(nullable NSURLSessionConfiguration *)configuration
|
||||||
|
clientID:(NSString *)clientID
|
||||||
|
secret:(NSString *)secret;
|
||||||
|
|
||||||
|
///---------------------
|
||||||
|
/// @name Authenticating
|
||||||
|
///---------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
Creates and enqueues an `NSURLSessionTask` to authenticate against the server using a specified username and password, with a designated scope.
|
||||||
|
|
||||||
|
@param URLString The URL string used to create the request URL.
|
||||||
|
@param username The username used for authentication
|
||||||
|
@param password The password used for authentication
|
||||||
|
@param scope The authorization scope
|
||||||
|
@param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes a single argument: the OAuth credential returned by the server.
|
||||||
|
@param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error returned from the server.
|
||||||
|
*/
|
||||||
|
- (NSURLSessionTask *)authenticateUsingOAuthWithURLString:(NSString *)URLString
|
||||||
|
username:(NSString *)username
|
||||||
|
password:(NSString *)password
|
||||||
|
scope:(nullable NSString *)scope
|
||||||
|
success:(void (^)(AFOAuthCredential *credential))success
|
||||||
|
failure:(void (^)(NSError *error))failure;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Creates and enqueues an `NSURLSessionTask` to authenticate against the server with a designated scope.
|
||||||
|
|
||||||
|
@param URLString The URL string used to create the request URL.
|
||||||
|
@param scope The authorization scope
|
||||||
|
@param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes a single argument: the OAuth credential returned by the server.
|
||||||
|
@param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error returned from the server.
|
||||||
|
*/
|
||||||
|
- (NSURLSessionTask *)authenticateUsingOAuthWithURLString:(NSString *)URLString
|
||||||
|
scope:(nullable NSString *)scope
|
||||||
|
success:(void (^)(AFOAuthCredential *credential))success
|
||||||
|
failure:(void (^)(NSError *error))failure;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Creates and enqueues an `NSURLSessionTask` to authenticate against the server using the specified refresh token.
|
||||||
|
@param URLString The URL string used to create the request URL.
|
||||||
|
@param refreshToken The OAuth refresh token
|
||||||
|
@param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes a single argument: the OAuth credential returned by the server.
|
||||||
|
@param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error returned from the server.
|
||||||
|
*/
|
||||||
|
- (NSURLSessionTask *)authenticateUsingOAuthWithURLString:(NSString *)URLString
|
||||||
|
refreshToken:(NSString *)refreshToken
|
||||||
|
success:(void (^)(AFOAuthCredential *credential))success
|
||||||
|
failure:(void (^)(NSError *error))failure;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Creates and enqueues an `NSURLSessionTask` to authenticate against the server with an authorization code, redirecting to a specified URI upon successful authentication.
|
||||||
|
@param URLString The URL string used to create the request URL.
|
||||||
|
@param code The authorization code
|
||||||
|
@param uri The URI to redirect to after successful authentication
|
||||||
|
@param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes a single argument: the OAuth credential returned by the server.
|
||||||
|
@param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error returned from the server.
|
||||||
|
*/
|
||||||
|
- (NSURLSessionTask *)authenticateUsingOAuthWithURLString:(NSString *)URLString
|
||||||
|
code:(NSString *)code
|
||||||
|
redirectURI:(NSString *)uri
|
||||||
|
success:(void (^)(AFOAuthCredential *credential))success
|
||||||
|
failure:(void (^)(NSError *error))failure;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Creates and enqueues an `NSURLSessionTask` to authenticate against the server with the specified parameters.
|
||||||
|
|
||||||
|
@param URLString The URL string used to create the request URL.
|
||||||
|
@param parameters The parameters to be encoded and set in the request HTTP body.
|
||||||
|
@param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes a single argument: the OAuth credential returned by the server.
|
||||||
|
@param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error returned from the server.
|
||||||
|
*/
|
||||||
|
- (NSURLSessionTask *)authenticateUsingOAuthWithURLString:(NSString *)URLString
|
||||||
|
parameters:(NSDictionary *)parameters
|
||||||
|
success:(void (^)(AFOAuthCredential *credential))success
|
||||||
|
failure:(void (^)(NSError *error))failure;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
///----------------
|
||||||
|
/// @name Constants
|
||||||
|
///----------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
## Error Domains
|
||||||
|
The following error domain is predefined.
|
||||||
|
- `NSString * const AFOAuth2ErrorDomain`
|
||||||
|
## OAuth Grant Types
|
||||||
|
OAuth 2.0 provides several grant types, covering several different use cases. The following grant type string constants are provided:
|
||||||
|
`kAFOAuthCodeGrantType`: "authorization_code"
|
||||||
|
`kAFOAuthClientCredentialsGrantType`: "client_credentials"
|
||||||
|
`kAFOAuthPasswordCredentialsGrantType`: "password"
|
||||||
|
`kAFOAuthRefreshGrantType`: "refresh_token"
|
||||||
|
*/
|
||||||
|
extern NSString * const AFOAuth2ErrorDomain;
|
||||||
|
|
||||||
|
extern NSString * const kAFOAuthCodeGrantType;
|
||||||
|
extern NSString * const kAFOAuthClientCredentialsGrantType;
|
||||||
|
extern NSString * const kAFOAuthPasswordCredentialsGrantType;
|
||||||
|
extern NSString * const kAFOAuthRefreshGrantType;
|
||||||
|
|
||||||
|
@compatibility_alias AFOAuth2Client AFOAuth2Manager;
|
||||||
|
@compatibility_alias AFOAuth2RequestOperationManager AFOAuth2Manager;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
275
Example/Pods/AFOAuth2Manager/AFOAuth2Manager/AFOAuth2Manager.m
generated
Normal file
275
Example/Pods/AFOAuth2Manager/AFOAuth2Manager/AFOAuth2Manager.m
generated
Normal file
@ -0,0 +1,275 @@
|
|||||||
|
// AFOAuth2Manager.m
|
||||||
|
//
|
||||||
|
// Copyright (c) 2012-2014 AFNetworking (http://afnetworking.com)
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
// in the Software without restriction, including without limitation the rights
|
||||||
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
// furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in
|
||||||
|
// all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
// THE SOFTWARE
|
||||||
|
|
||||||
|
#import "AFOAuth2Manager.h"
|
||||||
|
#import "AFOAuthCredential.h"
|
||||||
|
|
||||||
|
NSString * const kAFOAuthClientCredentialsGrantType = @"client_credentials";
|
||||||
|
NSString * const kAFOAuthPasswordCredentialsGrantType = @"password";
|
||||||
|
NSString * const kAFOAuthCodeGrantType = @"authorization_code";
|
||||||
|
NSString * const kAFOAuthRefreshGrantType = @"refresh_token";
|
||||||
|
|
||||||
|
NSString * const AFOAuth2ErrorDomain = @"com.alamofire.networking.oauth2.error";
|
||||||
|
|
||||||
|
// See: http://tools.ietf.org/html/rfc6749#section-5.2
|
||||||
|
static NSError * AFErrorFromRFC6749Section5_2Error(id object) {
|
||||||
|
if (![object valueForKey:@"error"] || [[object valueForKey:@"error"] isEqual:[NSNull null]]) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSMutableDictionary *mutableUserInfo = [NSMutableDictionary dictionary];
|
||||||
|
|
||||||
|
NSString *description = nil;
|
||||||
|
if ([object valueForKey:@"error_description"]) {
|
||||||
|
description = [object valueForKey:@"error_description"];
|
||||||
|
} else {
|
||||||
|
if ([[object valueForKey:@"error"] isEqualToString:@"invalid_request"]) {
|
||||||
|
description = NSLocalizedStringFromTable(@"The request is missing a required parameter, includes an unsupported parameter value (other than grant type), repeats a parameter, includes multiple credentials, utilizes more than one mechanism for authenticating the client, or is otherwise malformed.", @"AFOAuth2Manager", @"invalid_request");
|
||||||
|
} else if ([[object valueForKey:@"error"] isEqualToString:@"invalid_client"]) {
|
||||||
|
description = NSLocalizedStringFromTable(@"Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method). The authorization server MAY return an HTTP 401 (Unauthorized) status code to indicate which HTTP authentication schemes are supported. If the client attempted to authenticate via the \"Authorization\" request header field, the authorization server MUST respond with an HTTP 401 (Unauthorized) status code and include the \"WWW-Authenticate\" response header field matching the authentication scheme used by the client.", @"AFOAuth2Manager", @"invalid_request");
|
||||||
|
} else if ([[object valueForKey:@"error"] isEqualToString:@"invalid_grant"]) {
|
||||||
|
description = NSLocalizedStringFromTable(@"The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.", @"AFOAuth2Manager", @"invalid_request");
|
||||||
|
} else if ([[object valueForKey:@"error"] isEqualToString:@"unauthorized_client"]) {
|
||||||
|
description = NSLocalizedStringFromTable(@"The authenticated client is not authorized to use this authorization grant type.", @"AFOAuth2Manager", @"invalid_request");
|
||||||
|
} else if ([[object valueForKey:@"error"] isEqualToString:@"unsupported_grant_type"]) {
|
||||||
|
description = NSLocalizedStringFromTable(@"The authorization grant type is not supported by the authorization server.", @"AFOAuth2Manager", @"invalid_request");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (description) {
|
||||||
|
mutableUserInfo[NSLocalizedDescriptionKey] = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ([object valueForKey:@"error_uri"]) {
|
||||||
|
mutableUserInfo[NSLocalizedRecoverySuggestionErrorKey] = [object valueForKey:@"error_uri"];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [NSError errorWithDomain:AFOAuth2ErrorDomain code:-1 userInfo:mutableUserInfo];
|
||||||
|
}
|
||||||
|
|
||||||
|
@interface AFOAuth2Manager()
|
||||||
|
@property (readwrite, nonatomic, copy) NSString *serviceProviderIdentifier;
|
||||||
|
@property (readwrite, nonatomic, copy) NSString *clientID;
|
||||||
|
@property (readwrite, nonatomic, copy) NSString *secret;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation AFOAuth2Manager
|
||||||
|
|
||||||
|
+ (instancetype) managerWithBaseURL:(NSURL *)url
|
||||||
|
clientID:(NSString *)clientID
|
||||||
|
secret:(NSString *)secret {
|
||||||
|
return [self managerWithBaseURL:url sessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration] clientID:clientID secret:secret];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (instancetype) managerWithBaseURL:(NSURL *)url
|
||||||
|
sessionConfiguration:(NSURLSessionConfiguration *)configuration
|
||||||
|
clientID:(NSString *)clientID
|
||||||
|
secret:(NSString *)secret {
|
||||||
|
return [[self alloc] initWithBaseURL:url sessionConfiguration:configuration clientID:clientID secret:secret];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)initWithBaseURL:(NSURL *)url
|
||||||
|
clientID:(NSString *)clientID
|
||||||
|
secret:(NSString *)secret {
|
||||||
|
return [self initWithBaseURL:url sessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration] clientID:clientID secret:secret];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)initWithBaseURL:(NSURL *)url
|
||||||
|
sessionConfiguration:(NSURLSessionConfiguration *)configuration
|
||||||
|
clientID:(NSString *)clientID
|
||||||
|
secret:(NSString *)secret {
|
||||||
|
NSParameterAssert(url);
|
||||||
|
NSParameterAssert(clientID);
|
||||||
|
NSParameterAssert(secret);
|
||||||
|
|
||||||
|
self = [super initWithBaseURL:url sessionConfiguration:configuration];
|
||||||
|
if (!self) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.serviceProviderIdentifier = [self.baseURL host];
|
||||||
|
self.clientID = clientID;
|
||||||
|
self.secret = secret;
|
||||||
|
self.useHTTPBasicAuthentication = YES;
|
||||||
|
|
||||||
|
[self.requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Accept"];
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark -
|
||||||
|
|
||||||
|
- (void)setUseHTTPBasicAuthentication:(BOOL)useHTTPBasicAuthentication {
|
||||||
|
_useHTTPBasicAuthentication = useHTTPBasicAuthentication;
|
||||||
|
|
||||||
|
if (self.useHTTPBasicAuthentication) {
|
||||||
|
[self.requestSerializer setAuthorizationHeaderFieldWithUsername:self.clientID password:self.secret];
|
||||||
|
} else {
|
||||||
|
[self.requestSerializer setValue:nil forHTTPHeaderField:@"Authorization"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setSecret:(NSString *)secret {
|
||||||
|
if (!secret) {
|
||||||
|
secret = @"";
|
||||||
|
}
|
||||||
|
|
||||||
|
_secret = secret;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark -
|
||||||
|
|
||||||
|
- (NSURLSessionTask *)authenticateUsingOAuthWithURLString:(NSString *)URLString
|
||||||
|
username:(NSString *)username
|
||||||
|
password:(NSString *)password
|
||||||
|
scope:(NSString *)scope
|
||||||
|
success:(void (^)(AFOAuthCredential * _Nonnull))success
|
||||||
|
failure:(void (^)(NSError * _Nonnull))failure {
|
||||||
|
NSParameterAssert(username);
|
||||||
|
NSParameterAssert(password);
|
||||||
|
|
||||||
|
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
|
||||||
|
[parameters setValue:kAFOAuthPasswordCredentialsGrantType forKey:@"grant_type"];
|
||||||
|
[parameters setValue:username forKey:@"username"];
|
||||||
|
[parameters setValue:password forKey:@"password"];
|
||||||
|
|
||||||
|
if (scope) {
|
||||||
|
[parameters setValue:scope forKey:@"scope"];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [self authenticateUsingOAuthWithURLString:URLString parameters:parameters success:success failure:failure];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSURLSessionTask *)authenticateUsingOAuthWithURLString:(NSString *)URLString
|
||||||
|
scope:(NSString *)scope
|
||||||
|
success:(void (^)(AFOAuthCredential * _Nonnull))success
|
||||||
|
failure:(void (^)(NSError * _Nonnull))failure {
|
||||||
|
|
||||||
|
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
|
||||||
|
[parameters setValue:kAFOAuthClientCredentialsGrantType forKey:@"grant_type"];
|
||||||
|
|
||||||
|
if (scope) {
|
||||||
|
[parameters setValue:scope forKey:@"scope"];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [self authenticateUsingOAuthWithURLString:URLString parameters:parameters success:success failure:failure];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- (NSURLSessionTask *)authenticateUsingOAuthWithURLString:(NSString *)URLString
|
||||||
|
refreshToken:(NSString *)refreshToken
|
||||||
|
success:(void (^)(AFOAuthCredential *credential))success
|
||||||
|
failure:(void (^)(NSError *error))failure
|
||||||
|
{
|
||||||
|
NSParameterAssert(refreshToken);
|
||||||
|
|
||||||
|
NSDictionary *parameters = @{
|
||||||
|
@"grant_type": kAFOAuthRefreshGrantType,
|
||||||
|
@"refresh_token": refreshToken
|
||||||
|
};
|
||||||
|
|
||||||
|
return [self authenticateUsingOAuthWithURLString:URLString parameters:parameters success:success failure:failure];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSURLSessionTask *)authenticateUsingOAuthWithURLString:(NSString *)URLString
|
||||||
|
code:(NSString *)code
|
||||||
|
redirectURI:(NSString *)uri
|
||||||
|
success:(void (^)(AFOAuthCredential *credential))success
|
||||||
|
failure:(void (^)(NSError *error))failure
|
||||||
|
{
|
||||||
|
NSParameterAssert(code);
|
||||||
|
NSParameterAssert(uri);
|
||||||
|
|
||||||
|
NSDictionary *parameters = @{
|
||||||
|
@"grant_type": kAFOAuthCodeGrantType,
|
||||||
|
@"code": code,
|
||||||
|
@"redirect_uri": uri
|
||||||
|
};
|
||||||
|
|
||||||
|
return [self authenticateUsingOAuthWithURLString:URLString parameters:parameters success:success failure:failure];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSURLSessionTask *)authenticateUsingOAuthWithURLString:(NSString *)URLString
|
||||||
|
parameters:(NSDictionary *)parameters
|
||||||
|
success:(void (^)(AFOAuthCredential *credential))success
|
||||||
|
failure:(void (^)(NSError *error))failure
|
||||||
|
{
|
||||||
|
NSMutableDictionary *mutableParameters = [NSMutableDictionary dictionaryWithDictionary:parameters];
|
||||||
|
if (!self.useHTTPBasicAuthentication) {
|
||||||
|
mutableParameters[@"client_id"] = self.clientID;
|
||||||
|
mutableParameters[@"client_secret"] = self.secret;
|
||||||
|
}
|
||||||
|
parameters = [NSDictionary dictionaryWithDictionary:mutableParameters];
|
||||||
|
|
||||||
|
NSURLSessionTask *task;
|
||||||
|
task = [self POST:URLString parameters:parameters progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||||
|
if (!responseObject) {
|
||||||
|
if (failure) {
|
||||||
|
failure(nil);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ([responseObject valueForKey:@"error"]) {
|
||||||
|
if (failure) {
|
||||||
|
failure(AFErrorFromRFC6749Section5_2Error(responseObject));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NSString *refreshToken = [responseObject valueForKey:@"refresh_token"];
|
||||||
|
if (!refreshToken || [refreshToken isEqual:[NSNull null]]) {
|
||||||
|
refreshToken = [parameters valueForKey:@"refresh_token"];
|
||||||
|
}
|
||||||
|
|
||||||
|
AFOAuthCredential *credential = [AFOAuthCredential credentialWithOAuthToken:[responseObject valueForKey:@"access_token"] tokenType:[responseObject valueForKey:@"token_type"]];
|
||||||
|
|
||||||
|
|
||||||
|
if (refreshToken) { // refreshToken is optional in the OAuth2 spec
|
||||||
|
[credential setRefreshToken:refreshToken];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Expiration is optional, but recommended in the OAuth2 spec. It not provide, assume distantFuture === never expires
|
||||||
|
NSDate *expireDate = [NSDate distantFuture];
|
||||||
|
id expiresIn = [responseObject valueForKey:@"expires_in"];
|
||||||
|
if (expiresIn && ![expiresIn isEqual:[NSNull null]]) {
|
||||||
|
expireDate = [NSDate dateWithTimeIntervalSinceNow:[expiresIn doubleValue]];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (expireDate) {
|
||||||
|
[credential setExpiration:expireDate];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (success) {
|
||||||
|
success(credential);
|
||||||
|
}
|
||||||
|
|
||||||
|
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
||||||
|
if (failure) {
|
||||||
|
failure(error);
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
|
||||||
|
return task;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
158
Example/Pods/AFOAuth2Manager/AFOAuth2Manager/AFOAuthCredential.h
generated
Normal file
158
Example/Pods/AFOAuth2Manager/AFOAuth2Manager/AFOAuthCredential.h
generated
Normal file
@ -0,0 +1,158 @@
|
|||||||
|
// AFOAuthCredential.h
|
||||||
|
//
|
||||||
|
// Copyright (c) 2012-2014 AFNetworking (http://afnetworking.com)
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
// in the Software without restriction, including without limitation the rights
|
||||||
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
// furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in
|
||||||
|
// all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
// THE SOFTWARE.
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
/**
|
||||||
|
`AFOAuthCredential` models the credentials returned from an OAuth server, storing the token type, access & refresh tokens, and whether the token is expired.
|
||||||
|
|
||||||
|
OAuth credentials can be stored in the user's keychain, and retrieved on subsequent launches.
|
||||||
|
*/
|
||||||
|
@interface AFOAuthCredential : NSObject <NSCoding>
|
||||||
|
|
||||||
|
///--------------------------------------
|
||||||
|
/// @name Accessing Credential Properties
|
||||||
|
///--------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
The OAuth access token.
|
||||||
|
*/
|
||||||
|
@property (readonly, nonatomic, copy) NSString *accessToken;
|
||||||
|
|
||||||
|
/**
|
||||||
|
The OAuth token type (e.g. "bearer").
|
||||||
|
*/
|
||||||
|
@property (readonly, nonatomic, copy) NSString *tokenType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
The OAuth refresh token.
|
||||||
|
*/
|
||||||
|
@property (readonly, nonatomic, copy) NSString *refreshToken;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Whether the OAuth credentials are expired.
|
||||||
|
*/
|
||||||
|
@property (readonly, nonatomic, assign, getter = isExpired) BOOL expired;
|
||||||
|
|
||||||
|
///--------------------------------------------
|
||||||
|
/// @name Creating and Initializing Credentials
|
||||||
|
///--------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
Create an OAuth credential from a token string, with a specified type.
|
||||||
|
|
||||||
|
@param token The OAuth token string.
|
||||||
|
@param type The OAuth token type.
|
||||||
|
*/
|
||||||
|
+ (instancetype)credentialWithOAuthToken:(NSString *)token
|
||||||
|
tokenType:(NSString *)type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Initialize an OAuth credential from a token string, with a specified type.
|
||||||
|
|
||||||
|
@param token The OAuth token string.
|
||||||
|
@param type The OAuth token type.
|
||||||
|
*/
|
||||||
|
- (id)initWithOAuthToken:(NSString *)token
|
||||||
|
tokenType:(NSString *)type;
|
||||||
|
|
||||||
|
///----------------------------
|
||||||
|
/// @name Setting Refresh Token
|
||||||
|
///----------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
Set the credential refresh token, without a specific expiration
|
||||||
|
|
||||||
|
@param refreshToken The OAuth refresh token.
|
||||||
|
*/
|
||||||
|
- (void)setRefreshToken:(NSString *)refreshToken;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Set the expiration on the access token. If no expiration is given by the OAuth2 provider,
|
||||||
|
you may pass in [NSDate distantFuture]
|
||||||
|
|
||||||
|
@param expiration The expiration of the access token. This must not be `nil`.
|
||||||
|
*/
|
||||||
|
- (void)setExpiration:(NSDate *)expiration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Set the credential refresh token, with a specified expiration.
|
||||||
|
|
||||||
|
@param refreshToken The OAuth refresh token.
|
||||||
|
@param expiration The expiration of the access token. This must not be `nil`.
|
||||||
|
*/
|
||||||
|
- (void)setRefreshToken:(NSString *)refreshToken
|
||||||
|
expiration:(NSDate *)expiration;
|
||||||
|
|
||||||
|
///-----------------------------------------
|
||||||
|
/// @name Storing and Retrieving Credentials
|
||||||
|
///-----------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
Stores the specified OAuth credential for a given web service identifier in the Keychain.
|
||||||
|
with the default Keychain Accessibilty of kSecAttrAccessibleWhenUnlocked.
|
||||||
|
|
||||||
|
@param credential The OAuth credential to be stored.
|
||||||
|
@param identifier The service identifier associated with the specified credential.
|
||||||
|
|
||||||
|
@return Whether or not the credential was stored in the keychain.
|
||||||
|
*/
|
||||||
|
+ (BOOL)storeCredential:(AFOAuthCredential *)credential
|
||||||
|
withIdentifier:(NSString *)identifier;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Stores the specified OAuth token for a given web service identifier in the Keychain.
|
||||||
|
|
||||||
|
@param credential The OAuth credential to be stored.
|
||||||
|
@param identifier The service identifier associated with the specified token.
|
||||||
|
@param securityAccessibility The Keychain security accessibility to store the credential with.
|
||||||
|
|
||||||
|
@return Whether or not the credential was stored in the keychain.
|
||||||
|
*/
|
||||||
|
+ (BOOL)storeCredential:(AFOAuthCredential *)credential
|
||||||
|
withIdentifier:(NSString *)identifier
|
||||||
|
withAccessibility:(id)securityAccessibility;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Retrieves the OAuth credential stored with the specified service identifier from the Keychain.
|
||||||
|
|
||||||
|
@param identifier The service identifier associated with the specified credential.
|
||||||
|
|
||||||
|
@return The retrieved OAuth credential.
|
||||||
|
*/
|
||||||
|
+ (nullable AFOAuthCredential *)retrieveCredentialWithIdentifier:(NSString *)identifier;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Deletes the OAuth credential stored with the specified service identifier from the Keychain.
|
||||||
|
|
||||||
|
@param identifier The service identifier associated with the specified credential.
|
||||||
|
|
||||||
|
@return Whether or not the credential was deleted from the keychain.
|
||||||
|
*/
|
||||||
|
+ (BOOL)deleteCredentialWithIdentifier:(NSString *)identifier;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
184
Example/Pods/AFOAuth2Manager/AFOAuth2Manager/AFOAuthCredential.m
generated
Normal file
184
Example/Pods/AFOAuth2Manager/AFOAuth2Manager/AFOAuthCredential.m
generated
Normal file
@ -0,0 +1,184 @@
|
|||||||
|
// AFOAuthCredential.m
|
||||||
|
//
|
||||||
|
// Copyright (c) 2012-2014 AFNetworking (http://afnetworking.com)
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
// in the Software without restriction, including without limitation the rights
|
||||||
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
// furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in
|
||||||
|
// all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
// THE SOFTWARE
|
||||||
|
|
||||||
|
#import "AFOAuthCredential.h"
|
||||||
|
|
||||||
|
NSString * const kAFOAuth2CredentialServiceName = @"AFOAuthCredentialService";
|
||||||
|
|
||||||
|
static NSDictionary * AFKeychainQueryDictionaryWithIdentifier(NSString *identifier) {
|
||||||
|
NSCParameterAssert(identifier);
|
||||||
|
|
||||||
|
return @{
|
||||||
|
(__bridge id)kSecClass: (__bridge id)kSecClassGenericPassword,
|
||||||
|
(__bridge id)kSecAttrService: kAFOAuth2CredentialServiceName,
|
||||||
|
(__bridge id)kSecAttrAccount: identifier
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@interface AFOAuthCredential()
|
||||||
|
@property (readwrite, nonatomic, copy) NSString *accessToken;
|
||||||
|
@property (readwrite, nonatomic, copy) NSString *tokenType;
|
||||||
|
@property (readwrite, nonatomic, copy) NSString *refreshToken;
|
||||||
|
@property (readwrite, nonatomic, copy) NSDate *expiration;
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@implementation AFOAuthCredential
|
||||||
|
//@dynamic expired;
|
||||||
|
|
||||||
|
#pragma mark -
|
||||||
|
|
||||||
|
+ (instancetype)credentialWithOAuthToken:(NSString *)token
|
||||||
|
tokenType:(NSString *)type
|
||||||
|
{
|
||||||
|
return [[self alloc] initWithOAuthToken:token tokenType:type];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)initWithOAuthToken:(NSString *)token
|
||||||
|
tokenType:(NSString *)type
|
||||||
|
{
|
||||||
|
self = [super init];
|
||||||
|
if (!self) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.accessToken = token;
|
||||||
|
self.tokenType = type;
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)description {
|
||||||
|
return [NSString stringWithFormat:@"<%@ accessToken:\"%@\" tokenType:\"%@\" refreshToken:\"%@\" expiration:\"%@\">", [self class], self.accessToken, self.tokenType, self.refreshToken, self.expiration];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setRefreshToken:(NSString *)refreshToken
|
||||||
|
{
|
||||||
|
_refreshToken = refreshToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setExpiration:(NSDate *)expiration
|
||||||
|
{
|
||||||
|
_expiration = expiration;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setRefreshToken:(NSString *)refreshToken
|
||||||
|
expiration:(NSDate *)expiration
|
||||||
|
{
|
||||||
|
NSParameterAssert(refreshToken);
|
||||||
|
NSParameterAssert(expiration);
|
||||||
|
|
||||||
|
self.refreshToken = refreshToken;
|
||||||
|
self.expiration = expiration;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isExpired {
|
||||||
|
return [self.expiration compare:[NSDate date]] == NSOrderedAscending;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark Keychain
|
||||||
|
|
||||||
|
+ (BOOL)storeCredential:(AFOAuthCredential *)credential
|
||||||
|
withIdentifier:(NSString *)identifier
|
||||||
|
{
|
||||||
|
id securityAccessibility = nil;
|
||||||
|
#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 43000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090)
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||||
|
if (&kSecAttrAccessibleWhenUnlocked != NULL) {
|
||||||
|
securityAccessibility = (__bridge id)kSecAttrAccessibleWhenUnlocked;
|
||||||
|
}
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return [[self class] storeCredential:credential withIdentifier:identifier withAccessibility:securityAccessibility];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (BOOL)storeCredential:(AFOAuthCredential *)credential
|
||||||
|
withIdentifier:(NSString *)identifier
|
||||||
|
withAccessibility:(id)securityAccessibility
|
||||||
|
{
|
||||||
|
NSMutableDictionary *queryDictionary = [AFKeychainQueryDictionaryWithIdentifier(identifier) mutableCopy];
|
||||||
|
|
||||||
|
NSMutableDictionary *updateDictionary = [NSMutableDictionary dictionary];
|
||||||
|
updateDictionary[(__bridge id)kSecValueData] = [NSKeyedArchiver archivedDataWithRootObject:credential];
|
||||||
|
|
||||||
|
if (securityAccessibility) {
|
||||||
|
updateDictionary[(__bridge id)kSecAttrAccessible] = securityAccessibility;
|
||||||
|
}
|
||||||
|
|
||||||
|
OSStatus status;
|
||||||
|
BOOL exists = ([self retrieveCredentialWithIdentifier:identifier] != nil);
|
||||||
|
|
||||||
|
if (exists) {
|
||||||
|
status = SecItemUpdate((__bridge CFDictionaryRef)queryDictionary, (__bridge CFDictionaryRef)updateDictionary);
|
||||||
|
} else {
|
||||||
|
[queryDictionary addEntriesFromDictionary:updateDictionary];
|
||||||
|
status = SecItemAdd((__bridge CFDictionaryRef)queryDictionary, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (status == errSecSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (BOOL)deleteCredentialWithIdentifier:(NSString *)identifier {
|
||||||
|
NSMutableDictionary *queryDictionary = [AFKeychainQueryDictionaryWithIdentifier(identifier) mutableCopy];
|
||||||
|
|
||||||
|
OSStatus status = SecItemDelete((__bridge CFDictionaryRef)queryDictionary);
|
||||||
|
|
||||||
|
return (status == errSecSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (AFOAuthCredential *)retrieveCredentialWithIdentifier:(NSString *)identifier {
|
||||||
|
NSMutableDictionary *queryDictionary = [AFKeychainQueryDictionaryWithIdentifier(identifier) mutableCopy];
|
||||||
|
queryDictionary[(__bridge id)kSecReturnData] = (__bridge id)kCFBooleanTrue;
|
||||||
|
queryDictionary[(__bridge id)kSecMatchLimit] = (__bridge id)kSecMatchLimitOne;
|
||||||
|
|
||||||
|
CFDataRef result = nil;
|
||||||
|
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)queryDictionary, (CFTypeRef *)&result);
|
||||||
|
|
||||||
|
if (status != errSecSuccess) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
return [NSKeyedUnarchiver unarchiveObjectWithData:(__bridge_transfer NSData *)result];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - NSCoding
|
||||||
|
|
||||||
|
- (id)initWithCoder:(NSCoder *)decoder {
|
||||||
|
self = [super init];
|
||||||
|
self.accessToken = [decoder decodeObjectForKey:NSStringFromSelector(@selector(accessToken))];
|
||||||
|
self.tokenType = [decoder decodeObjectForKey:NSStringFromSelector(@selector(tokenType))];
|
||||||
|
self.refreshToken = [decoder decodeObjectForKey:NSStringFromSelector(@selector(refreshToken))];
|
||||||
|
self.expiration = [decoder decodeObjectForKey:NSStringFromSelector(@selector(expiration))];
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)encodeWithCoder:(NSCoder *)encoder {
|
||||||
|
[encoder encodeObject:self.accessToken forKey:NSStringFromSelector(@selector(accessToken))];
|
||||||
|
[encoder encodeObject:self.tokenType forKey:NSStringFromSelector(@selector(tokenType))];
|
||||||
|
[encoder encodeObject:self.refreshToken forKey:NSStringFromSelector(@selector(refreshToken))];
|
||||||
|
[encoder encodeObject:self.expiration forKey:NSStringFromSelector(@selector(expiration))];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
19
Example/Pods/AFOAuth2Manager/LICENSE
generated
Normal file
19
Example/Pods/AFOAuth2Manager/LICENSE
generated
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) 2011-2014 AFNetworking (http://afnetworking.com)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
68
Example/Pods/AFOAuth2Manager/README.md
generated
Normal file
68
Example/Pods/AFOAuth2Manager/README.md
generated
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
# AFOAuth2Manager
|
||||||
|
|
||||||
|
AFOAuth2Manager is an extension for [AFNetworking](http://github.com/AFNetworking/AFNetworking/) that simplifies the process of authenticating against an [OAuth 2](https://tools.ietf.org/html/rfc6749) provider.
|
||||||
|
|
||||||
|
## Example Usage
|
||||||
|
|
||||||
|
### Authentication
|
||||||
|
|
||||||
|
```objective-c
|
||||||
|
NSURL *baseURL = [NSURL URLWithString:@"http://example.com/"];
|
||||||
|
AFOAuth2Manager *OAuth2Manager =
|
||||||
|
[[AFOAuth2Manager alloc] initWithBaseURL:baseURL
|
||||||
|
clientID:kClientID
|
||||||
|
secret:kClientSecret];
|
||||||
|
|
||||||
|
[OAuth2Manager authenticateUsingOAuthWithURLString:@"/oauth/token"
|
||||||
|
username:@"username"
|
||||||
|
password:@"password"
|
||||||
|
scope:@"email"
|
||||||
|
success:^(AFOAuthCredential *credential) {
|
||||||
|
NSLog(@"Token: %@", credential.accessToken);
|
||||||
|
}
|
||||||
|
failure:^(NSError *error) {
|
||||||
|
NSLog(@"Error: %@", error);
|
||||||
|
}];
|
||||||
|
```
|
||||||
|
|
||||||
|
### Authorizing Requests
|
||||||
|
|
||||||
|
```objective-c
|
||||||
|
AFHTTPSessionManager *manager =
|
||||||
|
[[AFHTTPSessionManager alloc] initWithBaseURL:baseURL];
|
||||||
|
|
||||||
|
[manager.requestSerializer setAuthorizationHeaderFieldWithCredential:credential];
|
||||||
|
|
||||||
|
[manager GET:@"/path/to/protected/resource"
|
||||||
|
parameters:nil
|
||||||
|
progress:nil
|
||||||
|
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||||
|
NSLog(@"Success: %@", responseObject);
|
||||||
|
}
|
||||||
|
failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
||||||
|
NSLog(@"Failure: %@", error);
|
||||||
|
}];
|
||||||
|
```
|
||||||
|
|
||||||
|
### Storing Credentials
|
||||||
|
|
||||||
|
```objective-c
|
||||||
|
[AFOAuthCredential storeCredential:credential
|
||||||
|
withIdentifier:serviceProviderIdentifier];
|
||||||
|
```
|
||||||
|
|
||||||
|
### Retrieving Credentials
|
||||||
|
|
||||||
|
```objective-c
|
||||||
|
AFOAuthCredential *credential =
|
||||||
|
[AFOAuthCredential retrieveCredentialWithIdentifier:serviceProviderIdentifier];
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
Documentation for all releases of AFOAuth2Manager are [available on CocoaDocs](http://cocoadocs.org/docsets/AFOAuth2Manager/).
|
||||||
|
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
AFOAuth2Manager is available under the MIT license. See the LICENSE file for more info.
|
||||||
31
Example/Pods/Local Podspecs/AFOAuth2Manager.podspec.json
generated
Normal file
31
Example/Pods/Local Podspecs/AFOAuth2Manager.podspec.json
generated
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"name": "AFOAuth2Manager",
|
||||||
|
"version": "3.0.0",
|
||||||
|
"license": "MIT",
|
||||||
|
"summary": "AFNetworking Extension for OAuth 2 Authentication.",
|
||||||
|
"homepage": "https://github.com/AFNetworking/AFOAuth2Manager",
|
||||||
|
"social_media_url": "https://twitter.com/AFNetworking",
|
||||||
|
"authors": {
|
||||||
|
"Mattt Thompson": "m@mattt.me"
|
||||||
|
},
|
||||||
|
"source": {
|
||||||
|
"git": "https://github.com/AFNetworking/AFOAuth2Manager.git",
|
||||||
|
"tag": "3.0.0"
|
||||||
|
},
|
||||||
|
"source_files": "AFOAuth2Manager",
|
||||||
|
"requires_arc": true,
|
||||||
|
"platforms": {
|
||||||
|
"ios": "7.0",
|
||||||
|
"osx": "10.9",
|
||||||
|
"tvos": "9.0",
|
||||||
|
"watchos": "2.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"AFNetworking/NSURLSession": [
|
||||||
|
"~>3.0"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ios": {
|
||||||
|
"frameworks": "Security"
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "PNObject",
|
"name": "PNObject",
|
||||||
"version": "0.2.3",
|
"version": "0.2.5",
|
||||||
"summary": "PNObject is a simple replica of the more complex ParseObject",
|
"summary": "PNObject is a simple replica of the more complex ParseObject",
|
||||||
"homepage": "https://github.com/giuseppenucifora/PNObject",
|
"homepage": "https://github.com/giuseppenucifora/PNObject",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@ -9,7 +9,7 @@
|
|||||||
},
|
},
|
||||||
"source": {
|
"source": {
|
||||||
"git": "https://github.com/giuseppenucifora/PNObject.git",
|
"git": "https://github.com/giuseppenucifora/PNObject.git",
|
||||||
"tag": "0.2.3"
|
"tag": "0.2.5"
|
||||||
},
|
},
|
||||||
"platforms": {
|
"platforms": {
|
||||||
"ios": "7.0"
|
"ios": "7.0"
|
||||||
|
|||||||
20
Example/Pods/Manifest.lock
generated
20
Example/Pods/Manifest.lock
generated
@ -14,6 +14,8 @@ PODS:
|
|||||||
- AFNetworking/Serialization (3.0.4)
|
- AFNetworking/Serialization (3.0.4)
|
||||||
- AFNetworking/UIKit (3.0.4):
|
- AFNetworking/UIKit (3.0.4):
|
||||||
- AFNetworking/NSURLSession
|
- AFNetworking/NSURLSession
|
||||||
|
- AFOAuth2Manager (3.0.0):
|
||||||
|
- AFNetworking/NSURLSession (~> 3.0)
|
||||||
- CodFis-Helper (0.1.2)
|
- CodFis-Helper (0.1.2)
|
||||||
- Expecta (1.0.5)
|
- Expecta (1.0.5)
|
||||||
- Expecta+Snapshots (2.0.0):
|
- Expecta+Snapshots (2.0.0):
|
||||||
@ -28,7 +30,7 @@ PODS:
|
|||||||
- NSString-Helper (1.0.2)
|
- NSString-Helper (1.0.2)
|
||||||
- nv-ios-http-status (0.0.1)
|
- nv-ios-http-status (0.0.1)
|
||||||
- PEAR-FileManager-iOS (1.3.1)
|
- PEAR-FileManager-iOS (1.3.1)
|
||||||
- PNObject (0.2.3):
|
- PNObject (0.2.5):
|
||||||
- AFNetworking
|
- AFNetworking
|
||||||
- CodFis-Helper
|
- CodFis-Helper
|
||||||
- NSDate_Utils
|
- NSDate_Utils
|
||||||
@ -42,6 +44,7 @@ PODS:
|
|||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- AFNetworking
|
- AFNetworking
|
||||||
|
- AFOAuth2Manager (from `https://github.com/AFNetworking/AFOAuth2Manager.git`, branch `3_0_0_branch`)
|
||||||
- CodFis-Helper
|
- CodFis-Helper
|
||||||
- Expecta
|
- Expecta
|
||||||
- Expecta+Snapshots
|
- Expecta+Snapshots
|
||||||
@ -56,11 +59,20 @@ DEPENDENCIES:
|
|||||||
- UIDevice-Utils
|
- UIDevice-Utils
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
|
AFOAuth2Manager:
|
||||||
|
:branch: 3_0_0_branch
|
||||||
|
:git: https://github.com/AFNetworking/AFOAuth2Manager.git
|
||||||
PNObject:
|
PNObject:
|
||||||
:path: "../"
|
:path: "../"
|
||||||
|
|
||||||
|
CHECKOUT OPTIONS:
|
||||||
|
AFOAuth2Manager:
|
||||||
|
:commit: b2c665b1d354ed322517cbfed004ec210c193200
|
||||||
|
:git: https://github.com/AFNetworking/AFOAuth2Manager.git
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
AFNetworking: a0075feb321559dc78d9d85b55d11caa19eabb93
|
AFNetworking: a0075feb321559dc78d9d85b55d11caa19eabb93
|
||||||
|
AFOAuth2Manager: 0566da1be64883e339813d411229fdc9a84dab7c
|
||||||
CodFis-Helper: f303810699f22dbcba8fb8c600545ac91fc3ec42
|
CodFis-Helper: f303810699f22dbcba8fb8c600545ac91fc3ec42
|
||||||
Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe
|
Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe
|
||||||
Expecta+Snapshots: 29b38dd695bc72a0ed2bea833937d78df41943ba
|
Expecta+Snapshots: 29b38dd695bc72a0ed2bea833937d78df41943ba
|
||||||
@ -69,11 +81,11 @@ SPEC CHECKSUMS:
|
|||||||
NSString-Helper: 0ee74919829a332f9838fa87b28cb2d1d991e92c
|
NSString-Helper: 0ee74919829a332f9838fa87b28cb2d1d991e92c
|
||||||
nv-ios-http-status: b6c2b5fc8656cc19e0d3000dadce2080b99d0e2f
|
nv-ios-http-status: b6c2b5fc8656cc19e0d3000dadce2080b99d0e2f
|
||||||
PEAR-FileManager-iOS: 3bc403f68a53483f5629aa822f4649e40275c4d3
|
PEAR-FileManager-iOS: 3bc403f68a53483f5629aa822f4649e40275c4d3
|
||||||
PNObject: 7bd9bb008740ecb0d8e5a8ab58606a4eb4d10132
|
PNObject: 7b3ba081925d7350724b7d6204b89c09a16dd6bf
|
||||||
Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2
|
Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2
|
||||||
StrongestPasswordValidator: 554de9038705e18904f0337903dfd3b85a6b271b
|
StrongestPasswordValidator: 554de9038705e18904f0337903dfd3b85a6b271b
|
||||||
UIDevice-Utils: 0beb5f9d2bd256a3efe05c1e43a2a8b8702199c4
|
UIDevice-Utils: 0beb5f9d2bd256a3efe05c1e43a2a8b8702199c4
|
||||||
|
|
||||||
PODFILE CHECKSUM: 3d7d9ec922a37131d59224a7700af30168ea90b1
|
PODFILE CHECKSUM: 37a34cf275bf360e24441736dd77a0f74d9fb210
|
||||||
|
|
||||||
COCOAPODS: 1.0.0.beta.2
|
COCOAPODS: 1.0.0.beta.3
|
||||||
|
|||||||
3275
Example/Pods/Pods.xcodeproj/project.pbxproj
generated
3275
Example/Pods/Pods.xcodeproj/project.pbxproj
generated
File diff suppressed because it is too large
Load Diff
@ -1,36 +1,39 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Scheme
|
<Scheme
|
||||||
LastUpgradeVersion = "0700"
|
LastUpgradeVersion = "0720"
|
||||||
version = "1.3">
|
version = "1.3">
|
||||||
<BuildAction
|
<BuildAction
|
||||||
parallelizeBuildables = "YES"
|
parallelizeBuildables = "YES"
|
||||||
buildImplicitDependencies = "YES">
|
buildImplicitDependencies = "YES">
|
||||||
<BuildActionEntries>
|
<BuildActionEntries>
|
||||||
<BuildActionEntry
|
<BuildActionEntry
|
||||||
buildForAnalyzing = "YES"
|
|
||||||
buildForTesting = "YES"
|
buildForTesting = "YES"
|
||||||
buildForRunning = "YES"
|
buildForRunning = "YES"
|
||||||
buildForProfiling = "YES"
|
buildForProfiling = "YES"
|
||||||
buildForArchiving = "YES">
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = 'primary'
|
BuildableIdentifier = "primary"
|
||||||
BlueprintIdentifier = 'E35BB1A0261F32B3489855CF'
|
BlueprintIdentifier = "C0097FF4C86D8E28452DFFE2EFB47059"
|
||||||
BlueprintName = 'PNObject'
|
BuildableName = "PNObject.framework"
|
||||||
ReferencedContainer = 'container:Pods.xcodeproj'
|
BlueprintName = "PNObject"
|
||||||
BuildableName = 'PNObject.framework'>
|
ReferencedContainer = "container:Pods.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</BuildActionEntry>
|
</BuildActionEntry>
|
||||||
</BuildActionEntries>
|
</BuildActionEntries>
|
||||||
</BuildAction>
|
</BuildAction>
|
||||||
<TestAction
|
<TestAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
buildConfiguration = "Debug">
|
<Testables>
|
||||||
|
</Testables>
|
||||||
<AdditionalOptions>
|
<AdditionalOptions>
|
||||||
</AdditionalOptions>
|
</AdditionalOptions>
|
||||||
</TestAction>
|
</TestAction>
|
||||||
<LaunchAction
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
launchStyle = "0"
|
launchStyle = "0"
|
||||||
@ -38,17 +41,25 @@
|
|||||||
ignoresPersistentStateOnLaunch = "NO"
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
debugDocumentVersioning = "YES"
|
debugDocumentVersioning = "YES"
|
||||||
debugServiceExtension = "internal"
|
debugServiceExtension = "internal"
|
||||||
buildConfiguration = "Debug"
|
|
||||||
allowLocationSimulation = "YES">
|
allowLocationSimulation = "YES">
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "C0097FF4C86D8E28452DFFE2EFB47059"
|
||||||
|
BuildableName = "PNObject.framework"
|
||||||
|
BlueprintName = "PNObject"
|
||||||
|
ReferencedContainer = "container:Pods.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
<AdditionalOptions>
|
<AdditionalOptions>
|
||||||
</AdditionalOptions>
|
</AdditionalOptions>
|
||||||
</LaunchAction>
|
</LaunchAction>
|
||||||
<ProfileAction
|
<ProfileAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
savedToolIdentifier = ""
|
savedToolIdentifier = ""
|
||||||
useCustomWorkingDirectory = "NO"
|
useCustomWorkingDirectory = "NO"
|
||||||
debugDocumentVersioning = "YES"
|
debugDocumentVersioning = "YES">
|
||||||
buildConfiguration = "Release"
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
||||||
</ProfileAction>
|
</ProfileAction>
|
||||||
<AnalyzeAction
|
<AnalyzeAction
|
||||||
buildConfiguration = "Debug">
|
buildConfiguration = "Debug">
|
||||||
|
|||||||
@ -2,25 +2,25 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>3.0.4</string>
|
<string>3.0.4</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
5
Example/Pods/Target Support Files/AFOAuth2Manager/AFOAuth2Manager-dummy.m
generated
Normal file
5
Example/Pods/Target Support Files/AFOAuth2Manager/AFOAuth2Manager-dummy.m
generated
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
@interface PodsDummy_AFOAuth2Manager : NSObject
|
||||||
|
@end
|
||||||
|
@implementation PodsDummy_AFOAuth2Manager
|
||||||
|
@end
|
||||||
4
Example/Pods/Target Support Files/AFOAuth2Manager/AFOAuth2Manager-prefix.pch
generated
Normal file
4
Example/Pods/Target Support Files/AFOAuth2Manager/AFOAuth2Manager-prefix.pch
generated
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#ifdef __OBJC__
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
9
Example/Pods/Target Support Files/AFOAuth2Manager/AFOAuth2Manager-umbrella.h
generated
Normal file
9
Example/Pods/Target Support Files/AFOAuth2Manager/AFOAuth2Manager-umbrella.h
generated
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
#import "AFHTTPRequestSerializer+OAuth2.h"
|
||||||
|
#import "AFOAuth2Manager.h"
|
||||||
|
#import "AFOAuthCredential.h"
|
||||||
|
|
||||||
|
FOUNDATION_EXPORT double AFOAuth2ManagerVersionNumber;
|
||||||
|
FOUNDATION_EXPORT const unsigned char AFOAuth2ManagerVersionString[];
|
||||||
|
|
||||||
6
Example/Pods/Target Support Files/AFOAuth2Manager/AFOAuth2Manager.modulemap
generated
Normal file
6
Example/Pods/Target Support Files/AFOAuth2Manager/AFOAuth2Manager.modulemap
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
framework module AFOAuth2Manager {
|
||||||
|
umbrella header "AFOAuth2Manager-umbrella.h"
|
||||||
|
|
||||||
|
export *
|
||||||
|
module * { export * }
|
||||||
|
}
|
||||||
6
Example/Pods/Target Support Files/AFOAuth2Manager/AFOAuth2Manager.xcconfig
generated
Normal file
6
Example/Pods/Target Support Files/AFOAuth2Manager/AFOAuth2Manager.xcconfig
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
|
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
|
||||||
|
OTHER_LDFLAGS = -framework "Security"
|
||||||
|
PODS_ROOT = ${SRCROOT}
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
|
||||||
|
SKIP_INSTALL = YES
|
||||||
26
Example/Pods/Target Support Files/AFOAuth2Manager/Info.plist
generated
Normal file
26
Example/Pods/Target Support Files/AFOAuth2Manager/Info.plist
generated
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>en</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>${PRODUCT_NAME}</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>FMWK</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>3.0.0</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
|
<key>NSPrincipalClass</key>
|
||||||
|
<string></string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@ -2,25 +2,25 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.1.2</string>
|
<string>0.1.2</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -2,23 +2,23 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>BNDL</string>
|
<string>BNDL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.1.2</string>
|
<string>0.1.2</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -2,25 +2,25 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>2.0.0</string>
|
<string>2.0.0</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
40
Example/Pods/Target Support Files/Expecta/Info.plist
generated
40
Example/Pods/Target Support Files/Expecta/Info.plist
generated
@ -2,25 +2,25 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0.5</string>
|
<string>1.0.5</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -2,25 +2,25 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>2.0.7</string>
|
<string>2.0.7</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -2,25 +2,25 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.1.0</string>
|
<string>0.1.0</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -2,23 +2,23 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>BNDL</string>
|
<string>BNDL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.1.0</string>
|
<string>0.1.0</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -2,25 +2,25 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0.2</string>
|
<string>1.0.2</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -2,23 +2,23 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>BNDL</string>
|
<string>BNDL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0.2</string>
|
<string>1.0.2</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -2,25 +2,25 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.3.1</string>
|
<string>1.3.1</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -2,25 +2,25 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.2.3</string>
|
<string>0.2.5</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -2,23 +2,23 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>BNDL</string>
|
<string>BNDL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.2.3</string>
|
<string>0.2.5</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -24,6 +24,29 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
## AFOAuth2Manager
|
||||||
|
|
||||||
|
Copyright (c) 2011-2014 AFNetworking (http://afnetworking.com)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
## CodFis-Helper
|
## CodFis-Helper
|
||||||
|
|
||||||
Copyright (c) 2015 Giuseppe Nucifora <me@giuseppenucifora.com>
|
Copyright (c) 2015 Giuseppe Nucifora <me@giuseppenucifora.com>
|
||||||
|
|||||||
@ -39,6 +39,33 @@ THE SOFTWARE.
|
|||||||
<key>Type</key>
|
<key>Type</key>
|
||||||
<string>PSGroupSpecifier</string>
|
<string>PSGroupSpecifier</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>FooterText</key>
|
||||||
|
<string>Copyright (c) 2011-2014 AFNetworking (http://afnetworking.com)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
</string>
|
||||||
|
<key>Title</key>
|
||||||
|
<string>AFOAuth2Manager</string>
|
||||||
|
<key>Type</key>
|
||||||
|
<string>PSGroupSpecifier</string>
|
||||||
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>FooterText</key>
|
<key>FooterText</key>
|
||||||
<string>Copyright (c) 2015 Giuseppe Nucifora <me@giuseppenucifora.com>
|
<string>Copyright (c) 2015 Giuseppe Nucifora <me@giuseppenucifora.com>
|
||||||
|
|||||||
@ -85,6 +85,7 @@ strip_invalid_archs() {
|
|||||||
|
|
||||||
if [[ "$CONFIGURATION" == "Debug" ]]; then
|
if [[ "$CONFIGURATION" == "Debug" ]]; then
|
||||||
install_framework "Pods-PNObject_Example/AFNetworking.framework"
|
install_framework "Pods-PNObject_Example/AFNetworking.framework"
|
||||||
|
install_framework "Pods-PNObject_Example/AFOAuth2Manager.framework"
|
||||||
install_framework "Pods-PNObject_Example/CodFis_Helper.framework"
|
install_framework "Pods-PNObject_Example/CodFis_Helper.framework"
|
||||||
install_framework "Pods-PNObject_Example/NSDate_Utils.framework"
|
install_framework "Pods-PNObject_Example/NSDate_Utils.framework"
|
||||||
install_framework "Pods-PNObject_Example/NSString_Helper.framework"
|
install_framework "Pods-PNObject_Example/NSString_Helper.framework"
|
||||||
@ -96,6 +97,7 @@ if [[ "$CONFIGURATION" == "Debug" ]]; then
|
|||||||
fi
|
fi
|
||||||
if [[ "$CONFIGURATION" == "Release" ]]; then
|
if [[ "$CONFIGURATION" == "Release" ]]; then
|
||||||
install_framework "Pods-PNObject_Example/AFNetworking.framework"
|
install_framework "Pods-PNObject_Example/AFNetworking.framework"
|
||||||
|
install_framework "Pods-PNObject_Example/AFOAuth2Manager.framework"
|
||||||
install_framework "Pods-PNObject_Example/CodFis_Helper.framework"
|
install_framework "Pods-PNObject_Example/CodFis_Helper.framework"
|
||||||
install_framework "Pods-PNObject_Example/NSDate_Utils.framework"
|
install_framework "Pods-PNObject_Example/NSDate_Utils.framework"
|
||||||
install_framework "Pods-PNObject_Example/NSString_Helper.framework"
|
install_framework "Pods-PNObject_Example/NSString_Helper.framework"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||||
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/AFNetworking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/CodFis_Helper.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSDate_Utils.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSString_Helper.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PEAR_FileManager_iOS.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PNObject.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/StrongestPasswordValidator.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/UIDevice_Utils.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/nv_ios_http_status.framework/Headers"
|
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/AFNetworking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/AFOAuth2Manager.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/CodFis_Helper.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSDate_Utils.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSString_Helper.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PEAR_FileManager_iOS.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PNObject.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/StrongestPasswordValidator.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/UIDevice_Utils.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/nv_ios_http_status.framework/Headers"
|
||||||
OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "CodFis_Helper" -framework "NSDate_Utils" -framework "NSString_Helper" -framework "PEAR_FileManager_iOS" -framework "PNObject" -framework "StrongestPasswordValidator" -framework "UIDevice_Utils" -framework "nv_ios_http_status"
|
OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "AFOAuth2Manager" -framework "CodFis_Helper" -framework "NSDate_Utils" -framework "NSString_Helper" -framework "PEAR_FileManager_iOS" -framework "PNObject" -framework "StrongestPasswordValidator" -framework "UIDevice_Utils" -framework "nv_ios_http_status"
|
||||||
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-PNObject_Example
|
PODS_FRAMEWORK_BUILD_PATH = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-PNObject_Example"
|
||||||
PODS_ROOT = ${SRCROOT}/Pods
|
PODS_ROOT = ${SRCROOT}/Pods
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||||
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/AFNetworking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/CodFis_Helper.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSDate_Utils.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSString_Helper.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PEAR_FileManager_iOS.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PNObject.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/StrongestPasswordValidator.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/UIDevice_Utils.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/nv_ios_http_status.framework/Headers"
|
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/AFNetworking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/AFOAuth2Manager.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/CodFis_Helper.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSDate_Utils.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSString_Helper.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PEAR_FileManager_iOS.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PNObject.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/StrongestPasswordValidator.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/UIDevice_Utils.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/nv_ios_http_status.framework/Headers"
|
||||||
OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "CodFis_Helper" -framework "NSDate_Utils" -framework "NSString_Helper" -framework "PEAR_FileManager_iOS" -framework "PNObject" -framework "StrongestPasswordValidator" -framework "UIDevice_Utils" -framework "nv_ios_http_status"
|
OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "AFOAuth2Manager" -framework "CodFis_Helper" -framework "NSDate_Utils" -framework "NSString_Helper" -framework "PEAR_FileManager_iOS" -framework "PNObject" -framework "StrongestPasswordValidator" -framework "UIDevice_Utils" -framework "nv_ios_http_status"
|
||||||
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-PNObject_Example
|
PODS_FRAMEWORK_BUILD_PATH = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-PNObject_Example"
|
||||||
PODS_ROOT = ${SRCROOT}/Pods
|
PODS_ROOT = ${SRCROOT}/Pods
|
||||||
|
|||||||
@ -4,5 +4,5 @@ LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_pa
|
|||||||
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/AFNetworking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/CodFis_Helper.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Expecta.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Expecta_Snapshots.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FBSnapshotTestCase.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSDate_Utils.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSString_Helper.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PEAR_FileManager_iOS.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PNObject.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Specta.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/UIDevice_Utils.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/nv_ios_http_status.framework/Headers"
|
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/AFNetworking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/CodFis_Helper.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Expecta.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Expecta_Snapshots.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FBSnapshotTestCase.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSDate_Utils.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSString_Helper.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PEAR_FileManager_iOS.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PNObject.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Specta.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/UIDevice_Utils.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/nv_ios_http_status.framework/Headers"
|
||||||
OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "CodFis_Helper" -framework "Expecta" -framework "Expecta_Snapshots" -framework "FBSnapshotTestCase" -framework "NSDate_Utils" -framework "NSString_Helper" -framework "PEAR_FileManager_iOS" -framework "PNObject" -framework "Specta" -framework "UIDevice_Utils" -framework "nv_ios_http_status"
|
OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "CodFis_Helper" -framework "Expecta" -framework "Expecta_Snapshots" -framework "FBSnapshotTestCase" -framework "NSDate_Utils" -framework "NSString_Helper" -framework "PEAR_FileManager_iOS" -framework "PNObject" -framework "Specta" -framework "UIDevice_Utils" -framework "nv_ios_http_status"
|
||||||
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
||||||
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-PNObject_Tests
|
PODS_FRAMEWORK_BUILD_PATH = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-PNObject_Tests"
|
||||||
PODS_ROOT = ${SRCROOT}/Pods
|
PODS_ROOT = ${SRCROOT}/Pods
|
||||||
|
|||||||
@ -4,5 +4,5 @@ LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_pa
|
|||||||
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/AFNetworking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/CodFis_Helper.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Expecta.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Expecta_Snapshots.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FBSnapshotTestCase.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSDate_Utils.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSString_Helper.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PEAR_FileManager_iOS.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PNObject.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Specta.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/UIDevice_Utils.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/nv_ios_http_status.framework/Headers"
|
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/AFNetworking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/CodFis_Helper.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Expecta.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Expecta_Snapshots.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FBSnapshotTestCase.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSDate_Utils.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/NSString_Helper.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PEAR_FileManager_iOS.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PNObject.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Specta.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/UIDevice_Utils.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/nv_ios_http_status.framework/Headers"
|
||||||
OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "CodFis_Helper" -framework "Expecta" -framework "Expecta_Snapshots" -framework "FBSnapshotTestCase" -framework "NSDate_Utils" -framework "NSString_Helper" -framework "PEAR_FileManager_iOS" -framework "PNObject" -framework "Specta" -framework "UIDevice_Utils" -framework "nv_ios_http_status"
|
OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "CodFis_Helper" -framework "Expecta" -framework "Expecta_Snapshots" -framework "FBSnapshotTestCase" -framework "NSDate_Utils" -framework "NSString_Helper" -framework "PEAR_FileManager_iOS" -framework "PNObject" -framework "Specta" -framework "UIDevice_Utils" -framework "nv_ios_http_status"
|
||||||
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
||||||
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-PNObject_Tests
|
PODS_FRAMEWORK_BUILD_PATH = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-PNObject_Tests"
|
||||||
PODS_ROOT = ${SRCROOT}/Pods
|
PODS_ROOT = ${SRCROOT}/Pods
|
||||||
|
|||||||
40
Example/Pods/Target Support Files/Specta/Info.plist
generated
40
Example/Pods/Target Support Files/Specta/Info.plist
generated
@ -2,25 +2,25 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0.5</string>
|
<string>1.0.5</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -2,25 +2,25 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.1.1</string>
|
<string>0.1.1</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -2,23 +2,23 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>BNDL</string>
|
<string>BNDL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.1.1</string>
|
<string>0.1.1</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -2,25 +2,25 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.1.4</string>
|
<string>0.1.4</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -2,23 +2,23 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>BNDL</string>
|
<string>BNDL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.1.4</string>
|
<string>0.1.4</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -2,25 +2,25 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.0.1</string>
|
<string>0.0.1</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
Pod::Spec.new do |s|
|
Pod::Spec.new do |s|
|
||||||
s.name = "PNObject"
|
s.name = "PNObject"
|
||||||
s.version = "0.2.4"
|
s.version = "0.3.0"
|
||||||
s.summary = "PNObject is a simple replica of the more complex ParseObject"
|
s.summary = "PNObject is a simple replica of the more complex ParseObject"
|
||||||
|
|
||||||
# This description is used to generate tags and improve search results.
|
# This description is used to generate tags and improve search results.
|
||||||
@ -42,5 +42,7 @@ s.dependency 'UIDevice-Utils'
|
|||||||
s.dependency 'nv-ios-http-status'
|
s.dependency 'nv-ios-http-status'
|
||||||
s.dependency 'NSString-Helper'
|
s.dependency 'NSString-Helper'
|
||||||
s.dependency 'CodFis-Helper'
|
s.dependency 'CodFis-Helper'
|
||||||
|
s.dependency 'CodFis-Helper'
|
||||||
|
s.dependency 'StrongestPasswordValidator'
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,60 +0,0 @@
|
|||||||
//
|
|
||||||
// PNAccessToken.h
|
|
||||||
// Pods
|
|
||||||
//
|
|
||||||
// Created by Giuseppe Nucifora on 27/01/16.
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "PNObject.h"
|
|
||||||
|
|
||||||
@interface PNAccessToken : PNObject
|
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, TokenType) {
|
|
||||||
TokenTypeBasic = 1,
|
|
||||||
TokenTypeBearer = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gets singleton object of current user session.
|
|
||||||
*
|
|
||||||
* @return singleton
|
|
||||||
*/
|
|
||||||
+ (instancetype _Nonnull) currentAccessToken;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gets singleton object of current user session.
|
|
||||||
*
|
|
||||||
* @return singleton
|
|
||||||
*/
|
|
||||||
+ (instancetype _Nonnull) currentAccessTokenWithJSON:(NSDictionary *)JSON;
|
|
||||||
|
|
||||||
///--------------------------------------
|
|
||||||
#pragma mark - PNAccessToken Properties
|
|
||||||
///--------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <#Description#>
|
|
||||||
*/
|
|
||||||
@property (nonatomic, strong, nullable) NSString *accessToken;
|
|
||||||
/**
|
|
||||||
* <#Description#>
|
|
||||||
*/
|
|
||||||
@property (nonatomic, strong, nullable) NSDate *expirationDate;
|
|
||||||
|
|
||||||
@property (nonatomic, strong, nullable) NSNumber *expiresIn;
|
|
||||||
/**
|
|
||||||
* <#Description#>
|
|
||||||
*/
|
|
||||||
@property (nonatomic) TokenType tokenType;
|
|
||||||
|
|
||||||
@property (nonatomic, strong, nullable) NSString *tokenTypeString;
|
|
||||||
|
|
||||||
@property (nonatomic, strong, nullable) NSString *scope;
|
|
||||||
|
|
||||||
@property (nonatomic, strong, nullable) NSString *refreshToken;
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
||||||
@ -1,127 +0,0 @@
|
|||||||
//
|
|
||||||
// PNAccessToken.m
|
|
||||||
// Pods
|
|
||||||
//
|
|
||||||
// Created by Giuseppe Nucifora on 27/01/16.
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "PNAccessToken.h"
|
|
||||||
#import <NSDate_Utils/NSDate+NSDate_Util.h>
|
|
||||||
|
|
||||||
@interface PNAccessToken() <PNObjectSubclassing>
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation PNAccessToken
|
|
||||||
|
|
||||||
static PNAccessToken *SINGLETON = nil;
|
|
||||||
|
|
||||||
static bool isFirstAccess = YES;
|
|
||||||
|
|
||||||
#pragma mark - Public Method
|
|
||||||
|
|
||||||
+ (instancetype) currentAccessToken {
|
|
||||||
static dispatch_once_t onceToken;
|
|
||||||
dispatch_once(&onceToken, ^{
|
|
||||||
isFirstAccess = NO;
|
|
||||||
|
|
||||||
SINGLETON = [[super allocWithZone:NULL] initForCurrentAccessTokenWithJSON:nil];
|
|
||||||
});
|
|
||||||
|
|
||||||
return SINGLETON;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (instancetype _Nonnull) currentAccessTokenWithJSON:(NSDictionary *)JSON {
|
|
||||||
static dispatch_once_t onceToken;
|
|
||||||
dispatch_once(&onceToken, ^{
|
|
||||||
isFirstAccess = NO;
|
|
||||||
|
|
||||||
SINGLETON = [[super allocWithZone:NULL] initForCurrentAccessTokenWithJSON:JSON];
|
|
||||||
});
|
|
||||||
|
|
||||||
return SINGLETON;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
- (instancetype) initForCurrentAccessTokenWithJSON:(NSDictionary *)JSON {
|
|
||||||
if(SINGLETON){
|
|
||||||
return SINGLETON;
|
|
||||||
}
|
|
||||||
if (isFirstAccess) {
|
|
||||||
[self doesNotRecognizeSelector:_cmd];
|
|
||||||
}
|
|
||||||
NSDictionary *savedAccessToken;
|
|
||||||
|
|
||||||
if (JSON) {
|
|
||||||
savedAccessToken = JSON;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
savedAccessToken = [[PNObjectModel sharedInstance] fetchObjectsWithClass:[self class]];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (savedAccessToken) {
|
|
||||||
self = [super initWithJSON:savedAccessToken];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
self = [super init];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (self) {
|
|
||||||
if (_tokenTypeString) {
|
|
||||||
((void (^)())@{
|
|
||||||
@"beaer" : ^{
|
|
||||||
_tokenType = TokenTypeBearer;
|
|
||||||
},
|
|
||||||
@"basic" : ^{
|
|
||||||
_tokenType = TokenTypeBasic;
|
|
||||||
}
|
|
||||||
}[_tokenTypeString] ?: ^{
|
|
||||||
|
|
||||||
})();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_expiresIn) {
|
|
||||||
NSLog(@"%ld",[_expiresIn integerValue]);
|
|
||||||
NSLog(@"%@",[NSDate date]);
|
|
||||||
NSLog(@"%@",[[NSDate date] dateByAddingMinutes:[_expiresIn integerValue]]);
|
|
||||||
NSLog(@"%@",[[NSDate date] dateByAddingMinutes:10000]);
|
|
||||||
_expirationDate = [[NSDate date] dateByAddingMinutes:[_expiresIn integerValue]];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#pragma mark PNObjectSubclassing Protocol
|
|
||||||
|
|
||||||
+ (NSDictionary *)objcetMapping {
|
|
||||||
|
|
||||||
NSDictionary *mapping = @{
|
|
||||||
@"accessToken":@"access_token",
|
|
||||||
@"expiresIn":@"expires_in",
|
|
||||||
@"tokenTypeString":@"token_type",
|
|
||||||
@"tokenType":@"scope",
|
|
||||||
@"refreshToken":@"refresh_token",
|
|
||||||
};
|
|
||||||
return mapping;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (instancetype) initWithJSON:(NSDictionary *)JSON {
|
|
||||||
return [[self class] currentAccessTokenWithJSON:JSON];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (NSString *)objectClassName {
|
|
||||||
return @"AccessToken";
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (BOOL) singleInstance {
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark -
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
||||||
@ -14,6 +14,10 @@
|
|||||||
return @"Address";
|
return @"Address";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (NSString *)objectEndPoint {
|
||||||
|
return @"Address";
|
||||||
|
}
|
||||||
|
|
||||||
+ (NSDictionary *) objcetMapping {
|
+ (NSDictionary *) objcetMapping {
|
||||||
NSDictionary *mapping = @{@"country":@"country",
|
NSDictionary *mapping = @{@"country":@"country",
|
||||||
@"province":@"province",
|
@"province":@"province",
|
||||||
|
|||||||
@ -26,25 +26,29 @@ static bool isFirstAccess = YES;
|
|||||||
#pragma mark PNObjectSubclassing Protocol
|
#pragma mark PNObjectSubclassing Protocol
|
||||||
|
|
||||||
+ (NSDictionary *)objcetMapping {
|
+ (NSDictionary *)objcetMapping {
|
||||||
|
|
||||||
NSDictionary *mapping = @{
|
NSDictionary *mapping = @{
|
||||||
@"deviceType":@"deviceType",
|
@"deviceType":@"deviceType",
|
||||||
@"deviceModel":@"deviceModel",
|
@"deviceModel":@"deviceModel",
|
||||||
@"deviceName":@"deviceName",
|
@"deviceName":@"deviceName",
|
||||||
@"osVersion":@"osVersion",
|
@"osVersion":@"osVersion",
|
||||||
@"deviceToken":@"deviceToken",
|
@"deviceToken":@"deviceToken",
|
||||||
@"badge":@"badge",
|
@"badge":@"badge",
|
||||||
@"localeIdentifier":@"localeIdentifier",
|
@"localeIdentifier":@"localeIdentifier",
|
||||||
};
|
};
|
||||||
return mapping;
|
return mapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSString *)objectClassName {
|
+ (NSString *)objectClassName {
|
||||||
return @"AccessToken";
|
return @"Installation";
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (NSString *)objectEndPoint {
|
||||||
|
return @"Installation";
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (BOOL) singleInstance {
|
+ (BOOL) singleInstance {
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
@ -53,26 +57,26 @@ static bool isFirstAccess = YES;
|
|||||||
|
|
||||||
|
|
||||||
+ (instancetype) currentInstallation {
|
+ (instancetype) currentInstallation {
|
||||||
static dispatch_once_t onceToken;
|
static dispatch_once_t onceToken;
|
||||||
dispatch_once(&onceToken, ^{
|
dispatch_once(&onceToken, ^{
|
||||||
isFirstAccess = NO;
|
isFirstAccess = NO;
|
||||||
|
|
||||||
SINGLETON = [[super allocWithZone:NULL] init];
|
SINGLETON = [[super allocWithZone:NULL] init];
|
||||||
});
|
});
|
||||||
|
|
||||||
return SINGLETON;
|
return SINGLETON;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setDeviceTokenFromData:(NSData *)deviceTokenData {
|
- (void)setDeviceTokenFromData:(NSData *)deviceTokenData {
|
||||||
|
|
||||||
_deviceTokenData = deviceTokenData;
|
_deviceTokenData = deviceTokenData;
|
||||||
|
|
||||||
NSString *ptoken = [[[[deviceTokenData description]
|
NSString *ptoken = [[[[deviceTokenData description]
|
||||||
stringByReplacingOccurrencesOfString:@"<"withString:@""]
|
stringByReplacingOccurrencesOfString:@"<"withString:@""]
|
||||||
stringByReplacingOccurrencesOfString:@">" withString:@""]
|
stringByReplacingOccurrencesOfString:@">" withString:@""]
|
||||||
stringByReplacingOccurrencesOfString: @" " withString: @""];
|
stringByReplacingOccurrencesOfString: @" " withString: @""];
|
||||||
|
|
||||||
_deviceToken = ptoken;
|
_deviceToken = ptoken;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
@ -81,31 +85,31 @@ static bool isFirstAccess = YES;
|
|||||||
|
|
||||||
- (id) init
|
- (id) init
|
||||||
{
|
{
|
||||||
if(SINGLETON){
|
if(SINGLETON){
|
||||||
return SINGLETON;
|
return SINGLETON;
|
||||||
}
|
}
|
||||||
if (isFirstAccess) {
|
if (isFirstAccess) {
|
||||||
[self doesNotRecognizeSelector:_cmd];
|
[self doesNotRecognizeSelector:_cmd];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSDictionary *savedInstallation = [[PNObjectModel sharedInstance] fetchObjectsWithClass:[self class]];
|
NSDictionary *savedInstallation = [[PNObjectModel sharedInstance] fetchObjectsWithClass:[self class]];
|
||||||
|
|
||||||
if (savedInstallation) {
|
if (savedInstallation) {
|
||||||
self = [super initWithJSON:savedInstallation];
|
self = [super initWithJSON:savedInstallation];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
self = [super init];
|
self = [super init];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self) {
|
if (self) {
|
||||||
|
|
||||||
_deviceType = @"iOS";
|
_deviceType = @"iOS";
|
||||||
_deviceModel = [[UIDevice currentDevice] model];
|
_deviceModel = [[UIDevice currentDevice] model];
|
||||||
_osVersion = [[UIDevice currentDevice] systemVersion];
|
_osVersion = [[UIDevice currentDevice] systemVersion];
|
||||||
_deviceName = [[UIDevice currentDevice] name];
|
_deviceName = [[UIDevice currentDevice] name];
|
||||||
|
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|||||||
@ -14,6 +14,9 @@
|
|||||||
return @"Location";
|
return @"Location";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+(NSString *)objectEndPoint {
|
||||||
|
return @"Location";
|
||||||
|
}
|
||||||
|
|
||||||
+ (NSDictionary *) objcetMapping {
|
+ (NSDictionary *) objcetMapping {
|
||||||
NSDictionary *mapping = @{@"lat":@"lat",
|
NSDictionary *mapping = @{@"lat":@"lat",
|
||||||
|
|||||||
@ -7,7 +7,6 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "PNObject.h"
|
#import "PNObject.h"
|
||||||
#import "PNAccessToken.h"
|
|
||||||
|
|
||||||
@interface PNUser : PNObject
|
@interface PNUser : PNObject
|
||||||
|
|
||||||
|
|||||||
@ -27,119 +27,118 @@ static bool isFirstAccess = YES;
|
|||||||
#pragma mark - Public Method
|
#pragma mark - Public Method
|
||||||
|
|
||||||
+ (instancetype) currentUser {
|
+ (instancetype) currentUser {
|
||||||
static dispatch_once_t onceToken;
|
static dispatch_once_t onceToken;
|
||||||
dispatch_once(&onceToken, ^{
|
dispatch_once(&onceToken, ^{
|
||||||
isFirstAccess = NO;
|
isFirstAccess = NO;
|
||||||
|
|
||||||
SINGLETON = [[super allocWithZone:NULL] initForCurrentUser];
|
SINGLETON = [[super allocWithZone:NULL] initForCurrentUser];
|
||||||
});
|
});
|
||||||
|
|
||||||
return SINGLETON;
|
return SINGLETON;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Life Cycle
|
#pragma mark - Life Cycle
|
||||||
|
|
||||||
- (instancetype)copy
|
- (instancetype)copy
|
||||||
{
|
{
|
||||||
return [[PNUser alloc] init];
|
return [[PNUser alloc] init];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)mutableCopy
|
- (instancetype)mutableCopy
|
||||||
{
|
{
|
||||||
return [[PNUser alloc] init];
|
return [[PNUser alloc] init];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype) initForCurrentUser
|
- (instancetype) initForCurrentUser
|
||||||
{
|
{
|
||||||
if(SINGLETON){
|
if(SINGLETON){
|
||||||
return SINGLETON;
|
return SINGLETON;
|
||||||
}
|
}
|
||||||
if (isFirstAccess) {
|
if (isFirstAccess) {
|
||||||
[self doesNotRecognizeSelector:_cmd];
|
[self doesNotRecognizeSelector:_cmd];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSDictionary *savedUser = [[PNObjectModel sharedInstance] fetchObjectsWithClass:[self class]];
|
NSDictionary *savedUser = [[PNObjectModel sharedInstance] fetchObjectsWithClass:[self class]];
|
||||||
|
|
||||||
if (savedUser) {
|
if (savedUser) {
|
||||||
self = [super initWithJSON:savedUser];
|
self = [super initWithJSON:savedUser];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
self = [super init];
|
self = [super init];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self) {
|
if (self) {
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setEmail:(NSString *)email {
|
- (void) setEmail:(NSString *)email {
|
||||||
if ([email isValidEmail]) {
|
if ([email isValidEmail]) {
|
||||||
_email = email;
|
_email = email;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
NSLogDebug(@"insertedEmail is not valid.");
|
NSLogDebug(@"insertedEmail is not valid.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setPassword:(NSString *)password {
|
- (void) setPassword:(NSString *)password {
|
||||||
if ([self isValidPassword:password]) {
|
if ([self isValidPassword:password]) {
|
||||||
_password = password;
|
_password = password;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
NSLogDebug(@"Inserted Passord is not valid.Lenght must be >= %ld",(long)[[PNObjectConfig sharedInstance] minPasswordLenght]);
|
NSLogDebug(@"Inserted Passord is not valid.Lenght must be >= %ld",(long)[[PNObjectConfig sharedInstance] minPasswordLenght]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) isValidPassword:(NSString* _Nonnull) password {
|
- (BOOL) isValidPassword:(NSString* _Nonnull) password {
|
||||||
if ([password length] >= [[PNObjectConfig sharedInstance] minPasswordLenght]) {
|
if ([password length] >= [[PNObjectConfig sharedInstance] minPasswordLenght]) {
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
return NO;
|
return NO;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
- (NSString *) password {
|
|
||||||
return @"password is not readble";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)logout {
|
- (void)logout {
|
||||||
[self autoRemoveLocally];
|
[self autoRemoveLocally];
|
||||||
[self resetObject];
|
[self resetObject];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark PNObjectSubclassing Protocol
|
#pragma mark PNObjectSubclassing Protocol
|
||||||
|
|
||||||
+ (NSDictionary *)objcetMapping {
|
+ (NSDictionary *)objcetMapping {
|
||||||
|
|
||||||
NSDictionary *mapping = @{
|
NSDictionary *mapping = @{
|
||||||
@"userId":@"id",
|
@"userId":@"id",
|
||||||
@"firstName":@"firstName",
|
@"firstName":@"firstName",
|
||||||
@"lastName":@"lastName",
|
@"lastName":@"lastName",
|
||||||
@"profileImage":@"profileImage",
|
@"profileImage":@"profileImage",
|
||||||
@"sex":@"sex",
|
@"sex":@"sex",
|
||||||
@"birthDate":@"birthDate",
|
@"birthDate":@"birthDate",
|
||||||
@"phone":@"phone",
|
@"phone":@"phone",
|
||||||
@"password":@"password",
|
@"password":@"password",
|
||||||
@"hasAcceptedPrivacy":@"hasAcceptedPrivacy",
|
@"hasAcceptedPrivacy":@"hasAcceptedPrivacy",
|
||||||
@"hasAcceptedNewsletter":@"hasAcceptedNewsletter",
|
@"hasAcceptedNewsletter":@"hasAcceptedNewsletter",
|
||||||
@"hasVerifiedEmail":@"hasVerifiedEmail",
|
@"hasVerifiedEmail":@"hasVerifiedEmail",
|
||||||
@"emailVerifiedDate":@"emailVerifiedDate",
|
@"emailVerifiedDate":@"emailVerifiedDate",
|
||||||
@"email":@"email",
|
@"email":@"email",
|
||||||
@"username":@"username",
|
@"username":@"username",
|
||||||
@"publicProfile":@"public_profile",
|
@"publicProfile":@"public_profile",
|
||||||
@"loginCount":@"login_count",
|
@"loginCount":@"login_count",
|
||||||
@"facebookId":@"facebookId",
|
@"facebookId":@"facebookId",
|
||||||
@"facebookAccessToken":@"facebookAccessToken",
|
@"facebookAccessToken":@"facebookAccessToken",
|
||||||
};
|
};
|
||||||
return mapping;
|
return mapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSString *)objectClassName {
|
+ (NSString *)objectClassName {
|
||||||
return @"User";
|
return @"User";
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (NSString *) objectEndPoint {
|
||||||
|
return @"User";
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (BOOL) singleInstance {
|
+ (BOOL) singleInstance {
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|||||||
@ -10,8 +10,8 @@
|
|||||||
|
|
||||||
@interface PNObject (PNObjectConnection)
|
@interface PNObject (PNObjectConnection)
|
||||||
|
|
||||||
- (NSURLSessionDataTask * _Nonnull)GETWithProgress:(void (^ _Nullable)(NSProgress * _Nonnull))downloadProgress
|
+ (NSURLSessionDataTask * _Nonnull) GETWithProgress:(nullable void (^)(NSProgress * _Nonnull downloadProgress)) downloadProgress
|
||||||
success:(void (^ _Nullable)(NSURLSessionDataTask * _Nonnull, id _Nullable))success
|
success:(nullable void (^)(NSURLSessionDataTask * _Nullable task, PNObject * _Nullable responseObject))success
|
||||||
failure:(void (^ _Nullable)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure;
|
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error))failure;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -16,82 +16,64 @@
|
|||||||
|
|
||||||
@implementation PNObject (PNObjectConnection)
|
@implementation PNObject (PNObjectConnection)
|
||||||
|
|
||||||
|
+ (NSURLSessionDataTask * _Nonnull) GETWithProgress:(nullable void (^)(NSProgress * _Nonnull downloadProgress)) downloadProgress
|
||||||
|
success:(nullable void (^)(NSURLSessionDataTask * _Nullable task, PNObject * _Nullable responseObject))success
|
||||||
- (NSURLSessionDataTask * _Nonnull)GETWithProgress:(void (^ _Nullable)(NSProgress * _Nonnull))downloadProgress
|
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error))failure {
|
||||||
success:(void (^ _Nullable)(NSURLSessionDataTask * _Nonnull, id _Nullable))success
|
|
||||||
failure:(void (^ _Nullable)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure {
|
return [[[PNObjectConfig sharedInstance] manager] GET:[[[PNObjectConfig sharedInstance] baseUrl] stringByAppendingFormat:@"%@",[[self class] objectEndPoint]] parameters:nil progress:downloadProgress success:^(NSURLSessionDataTask *task, id responseObject) {
|
||||||
|
|
||||||
return [[[PNObjectConfig sharedInstance] manager] GET:[[[PNObjectConfig sharedInstance] PNObjEndpoint] stringByAppendingFormat:@"%@",[[self class] objectClassName]] parameters:nil progress:nil success:^(NSURLSessionTask *task, id responseObject) {
|
id PNObjectResponse = [[[self class] alloc] initWithJSON:[responseObject copy]];
|
||||||
|
|
||||||
|
if (success) {
|
||||||
NSLogDebug(@"JSON: %@", responseObject);
|
success(task,PNObjectResponse);
|
||||||
NSLogDebug(@"JSON: %@", [responseObject class]);
|
}
|
||||||
|
|
||||||
self.JSON = [[NSDictionary alloc] initWithDictionary:responseObject];
|
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
||||||
|
if (failure) {
|
||||||
[self populateObjectFromJSON:responseObject];
|
failure(task,error);
|
||||||
|
}
|
||||||
|
}];
|
||||||
} failure:^(NSURLSessionTask *operation, NSError *error) {
|
|
||||||
|
|
||||||
NSLogDebug(@"Error: %@", error);
|
|
||||||
|
|
||||||
}];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (NSURLSessionDataTask *)POSTWithProgress:(nullable void (^)(NSProgress * _Nonnull)) uploadProgress
|
/*+ (nullable NSURLSessionDataTask *) POSTConstructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> _Nonnull formData))block
|
||||||
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
|
progress:(nullable void (^)(NSProgress * _Nonnull uploadProgress)) uploadProgress
|
||||||
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure {
|
success:(nullable void (^)(NSURLSessionDataTask * _Nullable task, id _Nullable responseObject))success
|
||||||
|
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure {
|
||||||
return [[[PNObjectConfig sharedInstance] manager] POST:[[[PNObjectConfig sharedInstance] PNObjEndpoint] stringByAppendingFormat:@"%@",[[self class] objectClassName]]
|
|
||||||
parameters:[self JSONObject] constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
|
NSDictionary *parameters = [NSDictionary dictionary];
|
||||||
|
|
||||||
} progress:^(NSProgress * _Nonnull _uploadProgress) {
|
[[[PNObjectConfig sharedInstance] manager] POST:[[[PNObjectConfig sharedInstance] baseUrl] stringByAppendingFormat:@"%@",[[self class] objectEndPoint]]
|
||||||
if (uploadProgress) {
|
parameters:parameters constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
|
||||||
uploadProgress(_uploadProgress);
|
|
||||||
}
|
} progress:^(NSProgress * _Nonnull uploadProgress) {
|
||||||
} success:^(NSURLSessionDataTask * _Nonnull _task, id _Nullable _responseObject) {
|
|
||||||
if (success) {
|
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||||
success(_task,_responseObject);
|
|
||||||
}
|
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
||||||
} failure:^(NSURLSessionDataTask * _Nullable _task, NSError * _Nonnull _error) {
|
|
||||||
if (failure) {
|
}];
|
||||||
failure(_task,_error);
|
}
|
||||||
}
|
|
||||||
}];
|
- (NSURLSessionDataTask * _Nonnull) GETWithProgress:(nullable void (^)(NSProgress * _Nonnull downloadProgress)) downloadProgress
|
||||||
}
|
success:(nullable void (^)(NSURLSessionDataTask * _Nullable task, PNObject * _Nullable responseObject))success
|
||||||
|
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error))failure {
|
||||||
|
|
||||||
|
return [[[PNObjectConfig sharedInstance] manager] GET:[[[PNObjectConfig sharedInstance] baseUrl] stringByAppendingFormat:@"%@",[[self class] objectEndPoint]] parameters:nil progress:downloadProgress success:^(NSURLSessionDataTask *task, id responseObject) {
|
||||||
|
|
||||||
|
[self resetObject];
|
||||||
|
[self populateObjectFromJSON:responseObject];
|
||||||
|
|
||||||
|
if (success) {
|
||||||
|
success(task,self);
|
||||||
|
}
|
||||||
|
|
||||||
|
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
||||||
|
if (failure) {
|
||||||
|
failure(task,error);
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}*/
|
||||||
|
|
||||||
- (NSURLSessionDataTask *)PUTWithSuccess:(void (^)(NSURLSessionDataTask *task, id responseObject))success
|
|
||||||
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure {
|
|
||||||
|
|
||||||
return [[[PNObjectConfig sharedInstance] manager] PUT:[[[PNObjectConfig sharedInstance] PNObjEndpoint] stringByAppendingFormat:@"%@",[[self class] objectClassName]]
|
|
||||||
parameters:[self JSONObject]
|
|
||||||
success:^(NSURLSessionDataTask * _Nonnull _task, id _Nullable _responseObject) {
|
|
||||||
if (success) {
|
|
||||||
success(_task,_responseObject);
|
|
||||||
}
|
|
||||||
} failure:^(NSURLSessionDataTask * _Nullable _task, NSError * _Nonnull _error) {
|
|
||||||
if (failure) {
|
|
||||||
failure(_task,_error);
|
|
||||||
}
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSURLSessionDataTask *)DELETEWithSuccess:(void (^)(NSURLSessionDataTask *task, id responseObject))success
|
|
||||||
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure {
|
|
||||||
return [[[PNObjectConfig sharedInstance] manager] DELETE:[[[PNObjectConfig sharedInstance] PNObjEndpoint] stringByAppendingFormat:@"%@",[[self class] objectClassName]]
|
|
||||||
parameters:[self JSONObject]
|
|
||||||
success:^(NSURLSessionDataTask * _Nonnull _task, id _Nullable _responseObject) {
|
|
||||||
if (success) {
|
|
||||||
success(_task,_responseObject);
|
|
||||||
}
|
|
||||||
} failure:^(NSURLSessionDataTask * _Nullable _task, NSError * _Nonnull _error) {
|
|
||||||
if (failure) {
|
|
||||||
failure(_task,_error);
|
|
||||||
}
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -10,7 +10,6 @@
|
|||||||
#import "PNObjectConfig.h"
|
#import "PNObjectConfig.h"
|
||||||
#import "PNObjectModel.h"
|
#import "PNObjectModel.h"
|
||||||
|
|
||||||
|
|
||||||
@protocol PNObjectSubclassing <NSObject>
|
@protocol PNObjectSubclassing <NSObject>
|
||||||
|
|
||||||
@required
|
@required
|
||||||
@ -19,6 +18,8 @@
|
|||||||
|
|
||||||
+ (BOOL) singleInstance;
|
+ (BOOL) singleInstance;
|
||||||
|
|
||||||
|
+ (NSString * _Nonnull) objectEndPoint;
|
||||||
|
|
||||||
@optional
|
@optional
|
||||||
|
|
||||||
+ (NSString * _Nonnull ) objectClassName;
|
+ (NSString * _Nonnull ) objectClassName;
|
||||||
@ -29,6 +30,8 @@
|
|||||||
|
|
||||||
+ (NSString * _Nonnull) PNObjClassName;
|
+ (NSString * _Nonnull) PNObjClassName;
|
||||||
|
|
||||||
|
+ (NSString * _Nonnull) PNObjEndPoint;
|
||||||
|
|
||||||
- (_Nullable instancetype) initWithJSON:( NSDictionary * _Nonnull) JSON;
|
- (_Nullable instancetype) initWithJSON:( NSDictionary * _Nonnull) JSON;
|
||||||
|
|
||||||
- (id _Nonnull) saveLocally;
|
- (id _Nonnull) saveLocally;
|
||||||
@ -52,5 +55,4 @@
|
|||||||
*/
|
*/
|
||||||
@property (nonatomic, strong, nonnull) NSDictionary * JSONObject;
|
@property (nonatomic, strong, nonnull) NSDictionary * JSONObject;
|
||||||
|
|
||||||
|
@end
|
||||||
@end
|
|
||||||
@ -13,6 +13,7 @@
|
|||||||
#import "PNObjectConstants.h"
|
#import "PNObjectConstants.h"
|
||||||
#import "PNObject+Protected.h"
|
#import "PNObject+Protected.h"
|
||||||
#import "objc/runtime.h"
|
#import "objc/runtime.h"
|
||||||
|
#import "PNObject+PNObjectConnection.m"
|
||||||
|
|
||||||
#define PNOBJECT_DIR @"PNObjects"
|
#define PNOBJECT_DIR @"PNObjects"
|
||||||
|
|
||||||
@ -40,6 +41,10 @@
|
|||||||
return mapping;
|
return mapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (NSString *)objectEndPoint {
|
||||||
|
return NSStringFromClass([self class]);
|
||||||
|
}
|
||||||
|
|
||||||
+ (BOOL) singleInstance {
|
+ (BOOL) singleInstance {
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
@ -59,6 +64,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (NSString * _Nonnull) PNObjEndPoint {
|
||||||
|
if ([[self class] resolveClassMethod:@selector(objectEndPoint)]) {
|
||||||
|
return [[self class] objectEndPoint];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return [[super class] objectEndPoint];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
- (_Nullable instancetype) init {
|
- (_Nullable instancetype) init {
|
||||||
self = [super init];
|
self = [super init];
|
||||||
|
|
||||||
@ -92,7 +107,7 @@
|
|||||||
self = [super init];
|
self = [super init];
|
||||||
if (self) {
|
if (self) {
|
||||||
if ([[self class] isSubclassOfClass:[PNObject class]]) {
|
if ([[self class] isSubclassOfClass:[PNObject class]]) {
|
||||||
NSAssert([[self class] conformsToProtocol:@protocol(PNObjectSubclassing)], @"Subclass object must conform to PNObjectSubclassing");
|
NSAssert([[self class] conformsToProtocol:@protocol(PNObjectSubclassing)], @"Subclass object must conform to PNObjectSubclassing Protocol");
|
||||||
|
|
||||||
_objID = [[NSProcessInfo processInfo] globallyUniqueString];
|
_objID = [[NSProcessInfo processInfo] globallyUniqueString];
|
||||||
|
|
||||||
|
|||||||
@ -9,16 +9,32 @@
|
|||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <AFNetworking/AFNetworking.h>
|
#import <AFNetworking/AFNetworking.h>
|
||||||
|
|
||||||
|
#import <AFOAuth2Manager/AFOAuth2Manager.h>
|
||||||
|
#import <AFOAuth2Manager/AFHTTPRequestSerializer+OAuth2.h>
|
||||||
|
#import <AFOAuth2Manager/AFOAuthCredential.h>
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, Environment) {
|
typedef NS_ENUM(NSInteger, Environment) {
|
||||||
Development,
|
Development = 0,
|
||||||
Stage,
|
Stage = 1,
|
||||||
Production
|
Production = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
extern NSString* const EnvironmentProduction;
|
|
||||||
extern NSString* const EnvironmentStage;
|
|
||||||
extern NSString* const EnvironmentDevelopment;
|
|
||||||
|
|
||||||
|
#pragma mark LocalNotification Keys
|
||||||
|
|
||||||
|
extern NSString* _Nonnull const PNObjectLocalNotificationRefreshTokenClientCredentialSuccess;
|
||||||
|
extern NSString* _Nonnull const PNObjectLocalNotificationRefreshTokenClientCredentialFail;
|
||||||
|
extern NSString* _Nonnull const PNObjectLocalNotificationRefreshTokenUserSuccess;
|
||||||
|
extern NSString* _Nonnull const PNObjectLocalNotificationRefreshTokenUserFail;
|
||||||
|
|
||||||
|
#pragma mark -
|
||||||
|
|
||||||
|
extern NSString* _Nonnull const EnvironmentProduction;
|
||||||
|
extern NSString* _Nonnull const EnvironmentStage;
|
||||||
|
extern NSString* _Nonnull const EnvironmentDevelopment;
|
||||||
|
|
||||||
|
extern NSString* _Nonnull const Client_ID;
|
||||||
|
extern NSString* _Nonnull const Client_Secret;
|
||||||
|
|
||||||
@interface PNObjectConfig : NSObject
|
@interface PNObjectConfig : NSObject
|
||||||
|
|
||||||
@ -26,10 +42,10 @@ extern NSString* const EnvironmentDevelopment;
|
|||||||
* gets singleton object.
|
* gets singleton object.
|
||||||
* @return singleton
|
* @return singleton
|
||||||
*/
|
*/
|
||||||
+ (instancetype) sharedInstance;
|
+ (instancetype _Nonnull) sharedInstance;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Oauth is NO by default
|
||||||
*
|
*
|
||||||
* @param clientIdsForEnvironments
|
* @param clientIdsForEnvironments
|
||||||
* For example,
|
* For example,
|
||||||
@ -40,7 +56,22 @@ extern NSString* const EnvironmentDevelopment;
|
|||||||
*
|
*
|
||||||
* @return singleton
|
* @return singleton
|
||||||
*/
|
*/
|
||||||
+ (instancetype) initSharedInstanceForEnvironments:(NSDictionary *) endpointUrlsForEnvironments;
|
+ (instancetype _Nonnull) initSharedInstanceForEnvironments:(NSDictionary * _Nonnull) endpointUrlsForEnvironments;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param clientIdsForEnvironments
|
||||||
|
* For example,
|
||||||
|
* @{ PNObjectConfigDevelopment : @"https://development.it/api/v1",
|
||||||
|
* PNObjectConfigEnvStage : @"ttps://stage.it/api/v1",
|
||||||
|
* PNObjectConfigEnvProduction : @"ttps://production.it/api/v1"
|
||||||
|
* }
|
||||||
|
* @param oauthEnabled <#oauthEnabled description#>
|
||||||
|
*
|
||||||
|
* @return singleton
|
||||||
|
*/
|
||||||
|
+ (instancetype _Nonnull) initSharedInstanceForEnvironments:(NSDictionary * _Nonnull) endpointUrlsForEnvironments withOauth:(BOOL) oauthEnabled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <#Description#>
|
* <#Description#>
|
||||||
@ -49,12 +80,30 @@ extern NSString* const EnvironmentDevelopment;
|
|||||||
*/
|
*/
|
||||||
- (void) setEnvironment:(Environment) env;
|
- (void) setEnvironment:(Environment) env;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <#Description#>
|
||||||
|
*
|
||||||
|
* @param value <#value description#>
|
||||||
|
* @param key <#key description#>
|
||||||
|
*/
|
||||||
|
- (void) setHTTPHeaderValue:(NSString * _Nonnull)value forKey:(NSString * _Nonnull) key;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <#Description#>
|
||||||
|
*
|
||||||
|
* @param value <#value description#>
|
||||||
|
* @param key <#key description#>
|
||||||
|
*/
|
||||||
|
- (void) removeHTTPHeaderValueForKey:(NSString * _Nonnull) key;
|
||||||
|
|
||||||
|
- (void) setClientID:(NSString * _Nonnull) clientID clientSecret:(NSString* _Nonnull) clientSecret forEnv:(Environment) environment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <#Description#>
|
* <#Description#>
|
||||||
*
|
*
|
||||||
* @return <#return value description#>
|
* @return <#return value description#>
|
||||||
*/
|
*/
|
||||||
- (NSString *) PNObjEndpoint;
|
- (NSString * _Nonnull) baseUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <#Description#>
|
* <#Description#>
|
||||||
@ -70,7 +119,8 @@ extern NSString* const EnvironmentDevelopment;
|
|||||||
/**
|
/**
|
||||||
* <#Description#>
|
* <#Description#>
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, strong) AFHTTPSessionManager *manager;
|
@property (nonatomic, strong) AFOAuth2Manager *manager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <#Description#>
|
* <#Description#>
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,29 +1,49 @@
|
|||||||
//
|
//
|
||||||
// PNObjectConfig.m
|
// PNObjectConfig.m
|
||||||
// Pods
|
// Pods
|
||||||
//
|
//
|
||||||
// Created by Giuseppe Nucifora on 08/01/16.
|
// Created by Giuseppe Nucifora on 08/01/16.
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "PNObjectConfig.h"
|
#import "PNObjectConfig.h"
|
||||||
#import "PNObjectConstants.h"
|
#import "PNObjectConstants.h"
|
||||||
|
#import "PNUser.h"
|
||||||
|
|
||||||
|
|
||||||
|
NSString * const PNObjectLocalNotificationRefreshTokenClientCredentialSuccess = @"PNObjectLocalNotificationRefreshTokenClientCredentialSuccess";
|
||||||
|
NSString * const PNObjectLocalNotificationRefreshTokenClientCredentialFail = @"PNObjectLocalNotificationRefreshTokenClientCredentialFail";
|
||||||
|
|
||||||
|
|
||||||
|
NSString * const PNObjectLocalNotificationRefreshTokenUserSuccess = @"PNObjectLocalNotificationRefreshTokenUserSuccess";
|
||||||
|
NSString * const PNObjectLocalNotificationRefreshTokenUserFail = @"PNObjectLocalNotificationRefreshTokenUserFail";
|
||||||
|
|
||||||
|
|
||||||
NSInteger const minPassLenght = 4;
|
NSInteger const minPassLenght = 4;
|
||||||
|
|
||||||
|
NSString * const PNObjectServiceCredentialIdentifier = @"PNObjectServiceCredentialIdentifier";
|
||||||
|
|
||||||
NSString* const EnvironmentProduction = @"PNObjectConfigEnvProduction";
|
NSString* const EnvironmentProduction = @"PNObjectConfigEnvProduction";
|
||||||
NSString* const EnvironmentStage = @"PNObjectConfigEnvStage";
|
NSString* const EnvironmentStage = @"PNObjectConfigEnvStage";
|
||||||
NSString* const EnvironmentDevelopment = @"PNObjectConfigDevelopment";
|
NSString* const EnvironmentDevelopment = @"PNObjectConfigDevelopment";
|
||||||
|
|
||||||
|
NSString* const BaseUrl = @"base_url";
|
||||||
|
NSString* const Client_ID = @"client_id";
|
||||||
|
NSString* const Client_Secret = @"client_secret";
|
||||||
|
|
||||||
@interface PNObjectConfig()
|
@interface PNObjectConfig()
|
||||||
|
|
||||||
@property (nonatomic, strong) NSMutableDictionary *configuration;
|
@property (nonatomic) BOOL oauthEnabled;
|
||||||
@property (nonatomic, strong) NSString *currentEnvironment;
|
|
||||||
@property (nonatomic) BOOL devEnabled;
|
|
||||||
@property (nonatomic) BOOL stageEnabled;
|
|
||||||
@property (nonatomic) BOOL productionEnabled;
|
|
||||||
|
|
||||||
|
@property (nonatomic, strong) AFOAuthCredential *currentOauthCredential;
|
||||||
|
|
||||||
|
@property (nonatomic, strong) NSMutableDictionary *configuration;
|
||||||
|
@property (nonatomic, strong) NSMutableDictionary *headerFields;
|
||||||
|
@property (nonatomic) Environment currentEnv;
|
||||||
|
@property (nonatomic, strong) NSString *currentEndPointBaseUrl;
|
||||||
|
@property (nonatomic, strong) NSString *currentOAuthClientID;
|
||||||
|
@property (nonatomic, strong) NSString *currentOAuthClientSecret;
|
||||||
|
@property (nonatomic, strong) NSMutableArray *environments;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@ -39,136 +59,218 @@ static bool isFirstAccess = YES;
|
|||||||
|
|
||||||
+ (instancetype)sharedInstance
|
+ (instancetype)sharedInstance
|
||||||
{
|
{
|
||||||
static dispatch_once_t onceToken;
|
static dispatch_once_t onceToken;
|
||||||
dispatch_once(&onceToken, ^{
|
dispatch_once(&onceToken, ^{
|
||||||
isFirstAccess = NO;
|
isFirstAccess = NO;
|
||||||
SINGLETON = [[super allocWithZone:NULL] init];
|
SINGLETON = [[super allocWithZone:NULL] init];
|
||||||
});
|
});
|
||||||
|
|
||||||
return SINGLETON;
|
return SINGLETON;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Life Cycle
|
#pragma mark - Life Cycle
|
||||||
|
|
||||||
+ (instancetype) initSharedInstanceForEnvironments:(NSDictionary *) endpointUrlsForEnvironments {
|
+ (instancetype) initSharedInstanceForEnvironments:(NSDictionary *) endpointUrlsForEnvironments {
|
||||||
SINGLETON = [self sharedInstance];
|
return [self initSharedInstanceForEnvironments:endpointUrlsForEnvironments withOauth:NO];
|
||||||
|
}
|
||||||
if (SINGLETON) {
|
|
||||||
for (NSString *key in [endpointUrlsForEnvironments allKeys]) {
|
+ (instancetype) initSharedInstanceForEnvironments:(NSDictionary *) endpointUrlsForEnvironments withOauth:(BOOL) oauthEnabled {
|
||||||
|
SINGLETON = [self sharedInstance];
|
||||||
((void (^)())@{
|
|
||||||
EnvironmentDevelopment : ^{
|
if (SINGLETON) {
|
||||||
NSURL * endpointUrl = [NSURL URLWithString:[endpointUrlsForEnvironments objectForKey:key]];
|
SINGLETON.oauthEnabled = oauthEnabled;
|
||||||
if (endpointUrl) {
|
for (NSString *key in [endpointUrlsForEnvironments allKeys]) {
|
||||||
[SINGLETON.configuration setValue:[endpointUrl absoluteString] forKey:key];
|
|
||||||
SINGLETON.devEnabled = YES;
|
if ([SINGLETON.environments containsObject:key]) {
|
||||||
}
|
|
||||||
|
NSURL * endpointUrl = [NSURL URLWithString:[endpointUrlsForEnvironments objectForKey:key]];
|
||||||
},
|
if (endpointUrl) {
|
||||||
EnvironmentStage : ^{
|
[SINGLETON.configuration setValue:[NSDictionary dictionaryWithObjectsAndKeys:[endpointUrl absoluteString],BaseUrl, nil] forKey:key];
|
||||||
NSURL * endpointUrl = [NSURL URLWithString:[endpointUrlsForEnvironments objectForKey:key]];
|
}
|
||||||
if (endpointUrl) {
|
}
|
||||||
[SINGLETON.configuration setValue:[endpointUrl absoluteString] forKey:key];
|
}
|
||||||
SINGLETON.stageEnabled = YES;
|
NSAssert([SINGLETON.configuration objectForKey:EnvironmentProduction], @"EnvironmentProduction must be valid endpoint url");
|
||||||
}
|
[SINGLETON setEnvironment:Production];
|
||||||
},
|
|
||||||
EnvironmentProduction : ^{
|
|
||||||
NSURL * endpointUrl = [NSURL URLWithString:[endpointUrlsForEnvironments objectForKey:key]];
|
|
||||||
if (endpointUrl) {
|
}
|
||||||
[SINGLETON.configuration setValue:[endpointUrl absoluteString] forKey:key];
|
return SINGLETON;
|
||||||
SINGLETON.productionEnabled = YES;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}[key] ?: ^{
|
|
||||||
|
|
||||||
})();
|
|
||||||
}
|
|
||||||
NSAssert(SINGLETON.productionEnabled, @"EnvironmentProduction must be valid endpoint url");
|
|
||||||
SINGLETON.currentEnvironment = [[SINGLETON configuration] objectForKey:EnvironmentProduction];
|
|
||||||
|
|
||||||
}
|
|
||||||
return SINGLETON;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (id) allocWithZone:(NSZone *)zone
|
+ (id) allocWithZone:(NSZone *)zone
|
||||||
{
|
{
|
||||||
return [self sharedInstance];
|
return [self sharedInstance];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (id)copyWithZone:(struct _NSZone *)zone
|
+ (id)copyWithZone:(struct _NSZone *)zone
|
||||||
{
|
{
|
||||||
return [self sharedInstance];
|
return [self sharedInstance];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (id)mutableCopyWithZone:(struct _NSZone *)zone
|
+ (id)mutableCopyWithZone:(struct _NSZone *)zone
|
||||||
{
|
{
|
||||||
return [self sharedInstance];
|
return [self sharedInstance];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)copy
|
- (id)copy
|
||||||
{
|
{
|
||||||
return [[PNObjectConfig alloc] init];
|
return [[PNObjectConfig alloc] init];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)mutableCopy
|
- (id)mutableCopy
|
||||||
{
|
{
|
||||||
return [[PNObjectConfig alloc] init];
|
return [[PNObjectConfig alloc] init];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) init
|
- (id) init
|
||||||
{
|
{
|
||||||
if(SINGLETON){
|
if(SINGLETON){
|
||||||
return SINGLETON;
|
return SINGLETON;
|
||||||
}
|
}
|
||||||
if (isFirstAccess) {
|
if (isFirstAccess) {
|
||||||
[self doesNotRecognizeSelector:_cmd];
|
[self doesNotRecognizeSelector:_cmd];
|
||||||
}
|
}
|
||||||
self = [super init];
|
self = [super init];
|
||||||
|
|
||||||
if (self) {
|
if (self) {
|
||||||
_configuration = [[NSMutableDictionary alloc] init];
|
if (_oauthEnabled) {
|
||||||
_minPasswordLenght = minPassLenght;
|
_currentOauthCredential = [AFOAuthCredential retrieveCredentialWithIdentifier:PNObjectServiceCredentialIdentifier];
|
||||||
|
}
|
||||||
_manager = [AFHTTPSessionManager manager];
|
|
||||||
}
|
_environments = [[NSMutableArray alloc] initWithArray:@[EnvironmentDevelopment,EnvironmentStage,EnvironmentProduction]];
|
||||||
return self;
|
|
||||||
|
_configuration = [[NSMutableDictionary alloc] init];
|
||||||
|
_minPasswordLenght = minPassLenght;
|
||||||
|
|
||||||
|
_headerFields = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setEnvironment:(Environment) env {
|
- (void) setEnvironment:(Environment) env {
|
||||||
|
|
||||||
_currentEnvironment = nil;
|
_currentEnv = env;
|
||||||
|
_currentEndPointBaseUrl = nil;
|
||||||
switch (env) {
|
_currentOAuthClientID = nil;
|
||||||
case Development:{
|
_currentOAuthClientSecret = nil;
|
||||||
if (_devEnabled) {
|
|
||||||
_currentEnvironment = [_configuration objectForKey:EnvironmentDevelopment];
|
if (env < [_environments count]) {
|
||||||
}
|
if ([_configuration objectForKey:[_environments objectAtIndex:env]]) {
|
||||||
}
|
_currentEndPointBaseUrl = [[_configuration objectForKey:[_environments objectAtIndex:env]] objectForKey:BaseUrl];
|
||||||
break;
|
_currentOAuthClientID = [[_configuration objectForKey:[_environments objectAtIndex:env]] objectForKey:Client_ID];
|
||||||
case Stage:{
|
_currentOAuthClientSecret = [[_configuration objectForKey:[_environments objectAtIndex:env]] objectForKey:Client_Secret];
|
||||||
if (_stageEnabled) {
|
}
|
||||||
_currentEnvironment = [_configuration objectForKey:EnvironmentStage];
|
}
|
||||||
}
|
else {
|
||||||
}
|
_currentEndPointBaseUrl = [[_configuration objectForKey:EnvironmentProduction] objectForKey:BaseUrl];
|
||||||
break;
|
if ([[_configuration objectForKey:EnvironmentProduction] objectForKey:Client_ID]) {
|
||||||
case Production:
|
_currentOAuthClientID = [[_configuration objectForKey:EnvironmentProduction] objectForKey:Client_ID];
|
||||||
default:
|
}
|
||||||
if (_productionEnabled) {
|
if ([[_configuration objectForKey:EnvironmentProduction] objectForKey:Client_Secret]) {
|
||||||
_currentEnvironment = [_configuration objectForKey:EnvironmentProduction];
|
_currentOAuthClientSecret = [[_configuration objectForKey:EnvironmentProduction] objectForKey:Client_Secret];
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
}
|
NSLog(@"%@",[[_configuration objectForKey:[_environments objectAtIndex:env]] objectForKey:BaseUrl]);
|
||||||
|
|
||||||
NSAssert(_currentEnvironment,@"Selected environment generate error. Please check configuration");
|
NSAssert(_currentEndPointBaseUrl,@"Selected environment generate error. Please check configuration");
|
||||||
|
|
||||||
|
[self manager];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) PNObjEndpoint {
|
- (NSString *) baseUrl {
|
||||||
return _currentEnvironment;
|
return _currentEndPointBaseUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (AFHTTPSessionManager *) manager {
|
||||||
|
|
||||||
|
BOOL canTryRefreh = NO;
|
||||||
|
|
||||||
|
if (!_manager) {
|
||||||
|
_manager = [AFOAuth2Manager manager];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_oauthEnabled && _currentOAuthClientID && _currentOAuthClientSecret) {
|
||||||
|
|
||||||
|
if (![_manager clientID]) {
|
||||||
|
_manager = [AFOAuth2Manager managerWithBaseURL:[NSURL URLWithString:_currentEndPointBaseUrl] clientID:_currentOAuthClientID secret:_currentOAuthClientSecret];
|
||||||
|
}
|
||||||
|
|
||||||
|
[_manager setUseHTTPBasicAuthentication:NO];
|
||||||
|
|
||||||
|
canTryRefreh = YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (NSString *key in [_headerFields allKeys]) {
|
||||||
|
|
||||||
|
[[_manager requestSerializer] setValue:[_headerFields objectForKey:key] forHTTPHeaderField:key];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canTryRefreh) {
|
||||||
|
|
||||||
|
if (!_currentOauthCredential) {
|
||||||
|
|
||||||
|
[self tryRefreshToken];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
[[_manager requestSerializer] setAuthorizationHeaderFieldWithCredential:_currentOauthCredential];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) tryRefreshToken {
|
||||||
|
if (![PNUser currentUser]) {
|
||||||
|
[_manager authenticateUsingOAuthWithURLString:[_currentEndPointBaseUrl stringByAppendingString:@"oauth-token"] username:[[PNUser currentUser] username] password:[[PNUser currentUser] password] scope:kAFOAuthPasswordCredentialsGrantType success:^(AFOAuthCredential * _Nonnull credential) {
|
||||||
|
_currentOauthCredential = credential;
|
||||||
|
[_manager.requestSerializer setAuthorizationHeaderFieldWithCredential:_currentOauthCredential];
|
||||||
|
} failure:^(NSError * _Nonnull error) {
|
||||||
|
[[NSNotificationCenter defaultCenter] postNotificationName:PNObjectLocalNotificationRefreshTokenUserFail object:error];
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
[_manager authenticateUsingOAuthWithURLString:[_currentEndPointBaseUrl stringByAppendingString:@"oauth-token"] scope:kAFOAuthClientCredentialsGrantType success:^(AFOAuthCredential * _Nonnull credential) {
|
||||||
|
_currentOauthCredential = credential;
|
||||||
|
[_manager.requestSerializer setAuthorizationHeaderFieldWithCredential:_currentOauthCredential];
|
||||||
|
} failure:^(NSError * _Nonnull error) {
|
||||||
|
[[NSNotificationCenter defaultCenter] postNotificationName:PNObjectLocalNotificationRefreshTokenClientCredentialFail object:error];
|
||||||
|
}];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setAcceptablePasswordLenght:(NSUInteger) passLenght {
|
- (void) setAcceptablePasswordLenght:(NSUInteger) passLenght {
|
||||||
_minPasswordLenght = passLenght;
|
_minPasswordLenght = passLenght;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setHTTPHeaderValue:(NSString * _Nonnull)value forKey:(NSString * _Nonnull) key {
|
||||||
|
[_headerFields setObject:value forKey:key];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) removeHTTPHeaderValueForKey:(NSString * _Nonnull) key {
|
||||||
|
if ([_headerFields objectForKey:key]) {
|
||||||
|
[_headerFields removeObjectForKey:key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setClientID:(NSString * _Nonnull) clientID clientSecret:(NSString* _Nonnull) clientSecret forEnv:(Environment) environment {
|
||||||
|
|
||||||
|
if ([_configuration objectForKey:[_environments objectAtIndex:environment]]) {
|
||||||
|
|
||||||
|
NSMutableDictionary *currentConfigurationDict = [[NSMutableDictionary alloc] initWithDictionary:[_configuration objectForKey:[_environments objectAtIndex:environment]]];
|
||||||
|
[currentConfigurationDict setObject:clientID forKey:Client_ID];
|
||||||
|
[currentConfigurationDict setObject:clientSecret forKey:Client_Secret];
|
||||||
|
|
||||||
|
[_configuration setObject:currentConfigurationDict forKey:[_environments objectAtIndex:environment]];
|
||||||
|
|
||||||
|
if (_currentEnv == environment) {
|
||||||
|
[self setEnvironment:environment];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -27,252 +27,252 @@ static bool isFirstAccess = YES;
|
|||||||
|
|
||||||
+ (instancetype) sharedInstance
|
+ (instancetype) sharedInstance
|
||||||
{
|
{
|
||||||
static dispatch_once_t onceToken;
|
static dispatch_once_t onceToken;
|
||||||
dispatch_once(&onceToken, ^{
|
dispatch_once(&onceToken, ^{
|
||||||
isFirstAccess = NO;
|
isFirstAccess = NO;
|
||||||
SINGLETON = [[super allocWithZone:NULL] init];
|
SINGLETON = [[super allocWithZone:NULL] init];
|
||||||
});
|
});
|
||||||
|
|
||||||
return SINGLETON;
|
return SINGLETON;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString * _Nullable) objectName:(id _Nonnull) object {
|
- (NSString * _Nullable) objectName:(id _Nonnull) object {
|
||||||
|
|
||||||
BOOL isPNObjectSubclass = [[object class] isSubclassOfClass:[PNObject class]];
|
BOOL isPNObjectSubclass = [[object class] isSubclassOfClass:[PNObject class]];
|
||||||
|
|
||||||
if(isPNObjectSubclass) {
|
if(isPNObjectSubclass) {
|
||||||
|
|
||||||
if ([[object class] conformsToProtocol:@protocol(PNObjectSubclassing)]) {
|
if ([[object class] conformsToProtocol:@protocol(PNObjectSubclassing)]) {
|
||||||
|
|
||||||
NSString *className;
|
NSString *className;
|
||||||
//if ([[object subClassDelegate] respondsToSelector:@selector(objectClassName)]) {
|
//if ([[object subClassDelegate] respondsToSelector:@selector(objectClassName)]) {
|
||||||
|
|
||||||
@try {
|
@try {
|
||||||
|
|
||||||
className = (NSString *)[[object class] performSelector:@selector(objectClassName)];
|
className = (NSString *)[[object class] performSelector:@selector(objectClassName)];
|
||||||
|
|
||||||
}
|
}
|
||||||
@catch (NSException *exception) {
|
@catch (NSException *exception) {
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
@finally {
|
@finally {
|
||||||
return className;
|
return className;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) issetPNObjectModelForObject:(id _Nonnull) object {
|
- (BOOL) issetPNObjectModelForObject:(id _Nonnull) object {
|
||||||
|
|
||||||
NSString *className = [self objectName:object];
|
NSString *className = [self objectName:object];
|
||||||
|
|
||||||
if (!className) {
|
if (!className) {
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [_fileManager checkPath:className];
|
return [_fileManager checkPath:className];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
||||||
+ (id) allocWithZone:(NSZone *)zone
|
+ (id) allocWithZone:(NSZone *)zone
|
||||||
{
|
{
|
||||||
return [self sharedInstance];
|
return [self sharedInstance];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (id)copyWithZone:(struct _NSZone *)zone
|
+ (id)copyWithZone:(struct _NSZone *)zone
|
||||||
{
|
{
|
||||||
return [self sharedInstance];
|
return [self sharedInstance];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (id)mutableCopyWithZone:(struct _NSZone *)zone
|
+ (id)mutableCopyWithZone:(struct _NSZone *)zone
|
||||||
{
|
{
|
||||||
return [self sharedInstance];
|
return [self sharedInstance];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)copy
|
- (id)copy
|
||||||
{
|
{
|
||||||
return [[PNObjectModel alloc] init];
|
return [[PNObjectModel alloc] init];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)mutableCopy
|
- (id)mutableCopy
|
||||||
{
|
{
|
||||||
return [[PNObjectModel alloc] init];
|
return [[PNObjectModel alloc] init];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) init
|
- (id) init
|
||||||
{
|
{
|
||||||
if(SINGLETON){
|
if(SINGLETON){
|
||||||
return SINGLETON;
|
return SINGLETON;
|
||||||
}
|
}
|
||||||
if (isFirstAccess) {
|
if (isFirstAccess) {
|
||||||
[self doesNotRecognizeSelector:_cmd];
|
[self doesNotRecognizeSelector:_cmd];
|
||||||
}
|
}
|
||||||
self = [super init];
|
self = [super init];
|
||||||
|
|
||||||
if (self) {
|
if (self) {
|
||||||
_fileManager = [PEARFileManager sharedInstatnce];
|
_fileManager = [PEARFileManager sharedInstatnce];
|
||||||
|
|
||||||
[_fileManager setRootDirectory:k_ROOT_DIR_DOCUMENTS];
|
[_fileManager setRootDirectory:k_ROOT_DIR_DOCUMENTS];
|
||||||
NSLogDebug(@"%@",[_fileManager getRootDirectoryPath]);
|
NSLogDebug(@"%@",[_fileManager getRootDirectoryPath]);
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark Public Methods
|
#pragma mark Public Methods
|
||||||
|
|
||||||
- (id _Nonnull) fetchObjectsWithClass:(Class _Nonnull) class {
|
- (id _Nonnull) fetchObjectsWithClass:(Class _Nonnull) class {
|
||||||
BOOL isPNObjectSubclass = [class isSubclassOfClass:[PNObject class]];
|
BOOL isPNObjectSubclass = [class isSubclassOfClass:[PNObject class]];
|
||||||
|
|
||||||
if(isPNObjectSubclass) {
|
if(isPNObjectSubclass) {
|
||||||
|
|
||||||
NSString *className;
|
NSString *className;
|
||||||
|
|
||||||
@try {
|
@try {
|
||||||
|
|
||||||
className = (NSString *)[class performSelector:@selector(objectClassName)];
|
className = (NSString *)[class performSelector:@selector(objectClassName)];
|
||||||
|
|
||||||
}
|
}
|
||||||
@catch (NSException *exception) {
|
@catch (NSException *exception) {
|
||||||
|
|
||||||
}
|
}
|
||||||
@finally {
|
@finally {
|
||||||
|
|
||||||
if ([_fileManager checkPath:className]) {
|
if ([_fileManager checkPath:className]) {
|
||||||
return [NSKeyedUnarchiver unarchiveObjectWithData:[_fileManager fetchFileDataWithPath:className]];
|
return [NSKeyedUnarchiver unarchiveObjectWithData:[_fileManager fetchFileDataWithPath:className]];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id _Nonnull) saveLocally:(id _Nonnull) object {
|
- (id _Nonnull) saveLocally:(id _Nonnull) object {
|
||||||
|
|
||||||
BOOL isPNObjectSubclass = [[object class] isSubclassOfClass:[PNObject class]];
|
BOOL isPNObjectSubclass = [[object class] isSubclassOfClass:[PNObject class]];
|
||||||
|
|
||||||
if(isPNObjectSubclass) {
|
if(isPNObjectSubclass) {
|
||||||
|
|
||||||
if ([[object class] conformsToProtocol:@protocol(PNObjectSubclassing)]) {
|
if ([[object class] conformsToProtocol:@protocol(PNObjectSubclassing)]) {
|
||||||
|
|
||||||
if ([(PNObject*) object singleInstance]) {
|
if ([(PNObject*) object singleInstance]) {
|
||||||
|
|
||||||
SEL selector = NSSelectorFromString(@"JSONObject");
|
SEL selector = NSSelectorFromString(@"JSONObject");
|
||||||
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[PNObject class] instanceMethodSignatureForSelector:selector]];
|
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[PNObject class] instanceMethodSignatureForSelector:selector]];
|
||||||
[invocation setSelector:selector];
|
[invocation setSelector:selector];
|
||||||
[invocation setTarget:object];
|
[invocation setTarget:object];
|
||||||
[invocation invoke];
|
[invocation invoke];
|
||||||
|
|
||||||
NSDictionary *objectDict;
|
NSDictionary *objectDict;
|
||||||
[invocation getReturnValue:&objectDict];
|
[invocation getReturnValue:&objectDict];
|
||||||
|
|
||||||
NSData *objectData = [NSKeyedArchiver archivedDataWithRootObject:objectDict];
|
NSData *objectData = [NSKeyedArchiver archivedDataWithRootObject:objectDict];
|
||||||
|
|
||||||
if ([self issetPNObjectModelForObject:object]) {
|
if ([self issetPNObjectModelForObject:object]) {
|
||||||
if ([_fileManager updateFileWithData:objectData filePath:[self objectName:object] permisson:@(0755)]) {
|
if ([_fileManager updateFileWithData:objectData filePath:[self objectName:object] permisson:@(0755)]) {
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return [NSError errorWithDomain:NSLocalizedString(@"Object cannot be updated", @"") code:kHTTPStatusCodeBadRequest userInfo:nil];
|
return [NSError errorWithDomain:NSLocalizedString(@"Object cannot be updated", @"") code:kHTTPStatusCodeBadRequest userInfo:nil];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ([_fileManager createFileWithData:objectData filePath:[self objectName:object] permisson:@(0755)]) {
|
if ([_fileManager createFileWithData:objectData filePath:[self objectName:object] permisson:@(0755)]) {
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return [NSError errorWithDomain:NSLocalizedString(@"Object cannot be created", @"") code:kHTTPStatusCodeBadRequest userInfo:nil];
|
return [NSError errorWithDomain:NSLocalizedString(@"Object cannot be created", @"") code:kHTTPStatusCodeBadRequest userInfo:nil];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ([self issetPNObjectModelForObject:object]) {
|
if ([self issetPNObjectModelForObject:object]) {
|
||||||
|
|
||||||
NSData * data = [_fileManager fetchFileDataWithPath:[self objectName:object]];
|
NSData * data = [_fileManager fetchFileDataWithPath:[self objectName:object]];
|
||||||
|
|
||||||
NSMutableArray *objects = [[NSMutableArray alloc] initWithArray:[NSKeyedUnarchiver unarchiveObjectWithData:data]];
|
NSMutableArray *objects = [[NSMutableArray alloc] initWithArray:[NSKeyedUnarchiver unarchiveObjectWithData:data]];
|
||||||
|
|
||||||
|
|
||||||
SEL selector = NSSelectorFromString(@"JSONObject");
|
SEL selector = NSSelectorFromString(@"JSONObject");
|
||||||
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[PNObject class] instanceMethodSignatureForSelector:selector]];
|
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[PNObject class] instanceMethodSignatureForSelector:selector]];
|
||||||
[invocation setSelector:selector];
|
[invocation setSelector:selector];
|
||||||
[invocation setTarget:object];
|
[invocation setTarget:object];
|
||||||
[invocation invoke];
|
[invocation invoke];
|
||||||
|
|
||||||
NSDictionary *objectDict;
|
NSDictionary *objectDict;
|
||||||
[invocation getReturnValue:&objectDict];
|
[invocation getReturnValue:&objectDict];
|
||||||
|
|
||||||
NSLogDebug(@"%@",objectDict);
|
NSLogDebug(@"%@",objectDict);
|
||||||
|
|
||||||
[objects addObject:objectDict];
|
[objects addObject:objectDict];
|
||||||
|
|
||||||
NSData *objectData = [NSKeyedArchiver archivedDataWithRootObject:objects];
|
NSData *objectData = [NSKeyedArchiver archivedDataWithRootObject:objects];
|
||||||
|
|
||||||
if ([_fileManager updateFileWithData:objectData filePath:[self objectName:object] permisson:@(0755)]) {
|
if ([_fileManager updateFileWithData:objectData filePath:[self objectName:object] permisson:@(0755)]) {
|
||||||
|
|
||||||
return objects;
|
return objects;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return [NSError errorWithDomain:NSLocalizedString(@"Objects list cannot be updated", @"") code:kHTTPStatusCodeBadRequest userInfo:nil];
|
return [NSError errorWithDomain:NSLocalizedString(@"Objects list cannot be updated", @"") code:kHTTPStatusCodeBadRequest userInfo:nil];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
NSMutableArray *objects = [[NSMutableArray alloc] init];
|
NSMutableArray *objects = [[NSMutableArray alloc] init];
|
||||||
|
|
||||||
|
|
||||||
SEL selector = NSSelectorFromString(@"JSONObject");
|
SEL selector = NSSelectorFromString(@"JSONObject");
|
||||||
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[PNObject class] instanceMethodSignatureForSelector:selector]];
|
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[PNObject class] instanceMethodSignatureForSelector:selector]];
|
||||||
[invocation setSelector:selector];
|
[invocation setSelector:selector];
|
||||||
[invocation setTarget:object];
|
[invocation setTarget:object];
|
||||||
[invocation invoke];
|
[invocation invoke];
|
||||||
|
|
||||||
NSDictionary *objectDict;
|
NSDictionary *objectDict;
|
||||||
[invocation getReturnValue:&objectDict];
|
[invocation getReturnValue:&objectDict];
|
||||||
|
|
||||||
[objects addObject:objectDict];
|
[objects addObject:objectDict];
|
||||||
|
|
||||||
NSData *objectData = [NSKeyedArchiver archivedDataWithRootObject:objects];
|
NSData *objectData = [NSKeyedArchiver archivedDataWithRootObject:objects];
|
||||||
|
|
||||||
if ([_fileManager createFileWithData:objectData filePath:[self objectName:object] permisson:@(0755)]) {
|
if ([_fileManager createFileWithData:objectData filePath:[self objectName:object] permisson:@(0755)]) {
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return [NSError errorWithDomain:NSLocalizedString(@"Objects list cannot be created", @"") code:kHTTPStatusCodeBadRequest userInfo:nil];
|
return [NSError errorWithDomain:NSLocalizedString(@"Objects list cannot be created", @"") code:kHTTPStatusCodeBadRequest userInfo:nil];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return [NSError errorWithDomain:NSLocalizedString(@"passed object is not conform to protocol PNObjectSubclassing", @"") code:kHTTPStatusCodeBadRequest userInfo:nil];
|
return [NSError errorWithDomain:NSLocalizedString(@"passed object is not conform to protocol PNObjectSubclassing", @"") code:kHTTPStatusCodeBadRequest userInfo:nil];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return [NSError errorWithDomain:NSLocalizedString(@"passed object is not PNObject Subclass", @"") code:kHTTPStatusCodeBadRequest userInfo:nil];
|
return [NSError errorWithDomain:NSLocalizedString(@"passed object is not PNObject Subclass", @"") code:kHTTPStatusCodeBadRequest userInfo:nil];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id _Nonnull) saveNSUSerDefautls:(id _Nonnull) object {
|
- (id _Nonnull) saveNSUSerDefautls:(id _Nonnull) object {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) removeObjectLocally:(id _Nonnull) object {
|
- (BOOL) removeObjectLocally:(id _Nonnull) object {
|
||||||
BOOL isPNObjectSubclass = [[object class] isSubclassOfClass:[PNObject class]];
|
BOOL isPNObjectSubclass = [[object class] isSubclassOfClass:[PNObject class]];
|
||||||
|
|
||||||
if(isPNObjectSubclass) {
|
if(isPNObjectSubclass) {
|
||||||
|
|
||||||
if ([[object class] conformsToProtocol:@protocol(PNObjectSubclassing)]) {
|
if ([[object class] conformsToProtocol:@protocol(PNObjectSubclassing)]) {
|
||||||
|
|
||||||
if ([self issetPNObjectModelForObject:object]) {
|
if ([self issetPNObjectModelForObject:object]) {
|
||||||
return [_fileManager deletePath:[self objectName:object]];
|
return [_fileManager deletePath:[self objectName:object]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user