Skip to content

Supporting iOS8 frameworks and Carthage package manager #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Cartfile.private
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github "specta/specta" => 0.2
github "specta/expecta" => 0.3
github "erikdoe/ocmock" => 3.1
github "AliSoftware/OHHTTPStubs" => 3.1
12 changes: 9 additions & 3 deletions NXOAuth2Account+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@
// the full licence.
//

#import "NXOAuth2Account.h"
#import <OAuth2Client/NXOAuth2Account.h>

@protocol NXApplication;

@interface NXOAuth2Account (Private)

@property (nonatomic, readonly) id<NXApplication> application;

- (instancetype)initAccountWithOAuthClient:(NXOAuth2Client *)oauthClient
accountType:(NSString *)accountType;
accountType:(NSString *)accountType
application:(id<NXApplication>)app;

- (instancetype)initAccountWithAccessToken:(NXOAuth2AccessToken *)accessToken
accountType:(NSString *)accountType;
accountType:(NSString *)accountType
application:(id<NXApplication>)app /*NS_DESIGNATED_INITIALIZER*/ NS_REQUIRES_SUPER;

@end
26 changes: 26 additions & 0 deletions OAuth2Client-iOS-Framework/Info.plist
Original file line number Diff line number Diff line change
@@ -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>com.nxtbgthng.$(PRODUCT_NAME:rfc1034identifier)</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>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
19 changes: 19 additions & 0 deletions OAuth2Client-iOS-Framework/OAuth2Client-iOS-Framework.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// OAuth2Client-iOS-Framework.h
// OAuth2Client-iOS-Framework
//
// Created by dodikk on 2/8/15.
// Copyright (c) 2015 nxtbgthng. All rights reserved.
//

#import <UIKit/UIKit.h>

//! Project version number for OAuth2Client-iOS-Framework.
FOUNDATION_EXPORT double OAuth2Client_iOS_FrameworkVersionNumber;

//! Project version string for OAuth2Client-iOS-Framework.
FOUNDATION_EXPORT const unsigned char OAuth2Client_iOS_FrameworkVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <OAuth2Client_iOS_Framework/PublicHeader.h>


24 changes: 24 additions & 0 deletions OAuth2Client-iOS-FrameworkTests/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?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>com.nxtbgthng.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion OAuth2Client.framework-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.nxtbgthng.${PRODUCT_NAME:rfc1034identifier}</string>
<string>com.nxtbgthng.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
Expand Down
629 changes: 503 additions & 126 deletions OAuth2Client.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0610"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E91AEE51A87561B0060BD28"
BuildableName = "OAuth2Client.framework"
BlueprintName = "OAuth2Client-iOS-Framework"
ReferencedContainer = "container:OAuth2Client.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E91AEE51A87561B0060BD28"
BuildableName = "OAuth2Client.framework"
BlueprintName = "OAuth2Client-iOS-Framework"
ReferencedContainer = "container:OAuth2Client.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E91AEE51A87561B0060BD28"
BuildableName = "OAuth2Client.framework"
BlueprintName = "OAuth2Client-iOS-Framework"
ReferencedContainer = "container:OAuth2Client.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E91AEE51A87561B0060BD28"
BuildableName = "OAuth2Client.framework"
BlueprintName = "OAuth2Client-iOS-Framework"
ReferencedContainer = "container:OAuth2Client.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions OAuth2Client/NXApplication.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// NXApplication.h
// OAuth2Client
//
// Created by Oleksandr Dodatko on 2/2/15.
// Copyright (c) 2015 nxtbgthng. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol NXApplication <NSObject>

-(BOOL)openURL:(NSURL*)url;

@end
33 changes: 33 additions & 0 deletions OAuth2Client/NXOAuth2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// NXOAuth2.h
// OAuth2Client
//
// Created by Ullrich Schäfer on 13.09.10.
//
// Copyright 2010 nxtbgthng. All rights reserved.
//
// Licenced under the new BSD-licence.
// See README.md in this repository for
// the full licence.
//


#import <OAuth2Client/NXApplication.h>
#import <OAuth2Client/NXOAuth2Client.h>
#import <OAuth2Client/NXOAuth2ClientDelegate.h>
#import <OAuth2Client/NXOAuth2AccessToken.h>
#import <OAuth2Client/NXOAuth2Connection.h>
#import <OAuth2Client/NXOAuth2ConnectionDelegate.h>
#import <OAuth2Client/NXOAuth2TrustDelegate.h>
#import <OAuth2Client/NXOAuth2Constants.h>
#import <OAuth2Client/NXOAuth2FileStreamWrapper.h>
#import <OAuth2Client/NXOAuth2PostBodyStream.h>
#import <OAuth2Client/NXOAuth2AccountStore.h>
#import <OAuth2Client/NXOAuth2Account.h>
#import <OAuth2Client/NXOAuth2Request.h>

#pragma mark Helpers

#import <OAuth2Client/NSURL+NXOAuth2.h>
#import <OAuth2Client/NSString+NXOAuth2.h>
#import <OAuth2Client/NSData+NXOAuth2.h>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@

#import <Foundation/Foundation.h>

#import "NXOAuth2TrustDelegate.h"

@class NXOAuth2Account;
@class NXOAuth2Connection;
@protocol NXApplication;


#pragma mark Notifications

Expand Down Expand Up @@ -75,7 +76,13 @@ typedef void(^NXOAuth2PreparedAuthorizationURLHandler)(NSURL *preparedURL);
NSMutableDictionary *trustedCertificatesHandler;
}

+ (instancetype)sharedStore;
+(instancetype)sharedStoreForApplication:(id<NXApplication>)uiApplication;
-(instancetype)init NS_UNAVAILABLE;
+(instancetype)new NS_UNAVAILABLE;

// Private API
//-(instancetype)initWithApplication:(id<NXApplication>)uiApplication NS_DESIGNATED_INITIALIZER NS_REQUIRES_SUPER __attribute((nonnull));


#pragma mark Accessors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
//

#import <Foundation/Foundation.h>

#import "NXOAuth2ClientDelegate.h"
#import "NXOAuth2ConnectionDelegate.h"
#import <OAuth2Client/NXOAuth2ConnectionDelegate.h>

extern NSString * const NXOAuth2ClientConnectionContextTokenRequest;
extern NSString * const NXOAuth2ClientConnectionContextTokenRefresh;

@class NXOAuth2Connection, NXOAuth2AccessToken;
@class NXOAuth2Connection;
@class NXOAuth2AccessToken;
@protocol NXOAuth2ClientDelegate;

/*!
* The OAuth 2.0 client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
// the full licence.
//

#import "NXOAuth2Constants.h"
#import "NXOAuth2TrustDelegate.h"

#import <OAuth2Client/NXOAuth2TrustDelegate.h>

@class NXOAuth2Client;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
//

#import <Foundation/Foundation.h>
#import <OAuth2Client/NXOAuth2RequestCallbacks.h>

#import "NXOAuth2Constants.h"

@class NXOAuth2Client;
@protocol NXOAuth2ConnectionDelegate;
Expand Down Expand Up @@ -46,10 +46,6 @@ extern NSString * const NXOAuth2ConnectionDidStartNotification;
extern NSString * const NXOAuth2ConnectionDidEndNotification;


typedef void(^NXOAuth2ConnectionResponseHandler)(NSURLResponse *response, NSData *responseData, NSError *error);
typedef void(^NXOAuth2ConnectionSendingProgressHandler)(unsigned long long bytesSend, unsigned long long bytesTotal);


@interface NXOAuth2Connection : NSObject {
@private
NSURLConnection *connection;
Expand Down Expand Up @@ -87,11 +83,11 @@ typedef void(^NXOAuth2ConnectionSendingProgressHandler)(unsigned long long bytes
@property (nonatomic, strong) NSDictionary *userInfo;
@property (nonatomic, strong, readonly) NXOAuth2Client *client;

- (instancetype) initWithRequest:(NSMutableURLRequest *)request
requestParameters:(NSDictionary *)requestParameters
oauthClient:(NXOAuth2Client *)client
sendingProgressHandler:(NXOAuth2ConnectionSendingProgressHandler)sendingProgressHandler
responseHandler:(NXOAuth2ConnectionResponseHandler)responseHandler;
- (instancetype)initWithRequest:(NSMutableURLRequest *)request
requestParameters:(NSDictionary *)requestParameters
oauthClient:(NXOAuth2Client *)client
sendingProgressHandler:(NXOAuth2ConnectionSendingProgressHandler)sendingProgressHandler
responseHandler:(NXOAuth2ConnectionResponseHandler)responseHandler;

- (instancetype)initWithRequest:(NSMutableURLRequest *)request
requestParameters:(NSDictionary *)requestParameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
// the full licence.
//

#import "NXOAuth2Constants.h"
#import "NXOAuth2TrustDelegate.h"

#import <Foundation/Foundation.h>
#import <OAuth2Client/NXOAuth2TrustDelegate.h>

@class NXOAuth2Connection;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

- (instancetype)initWithParameters:(NSDictionary *)postParameters;

@property (readonly) NSString *boundary;
@property (readonly) unsigned long long length;
@property (readonly, nonatomic) NSString *boundary;
@property (readonly, nonatomic) unsigned long long length;

@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
//

#import <Foundation/Foundation.h>

#import "NXOAuth2Connection.h"
#import <OAuth2Client/NXOAuth2RequestCallbacks.h>

@class NXOAuth2Account;
@class NXOAuth2Connection;

@interface NXOAuth2Request : NSObject {
@private
Expand Down
19 changes: 19 additions & 0 deletions OAuth2Client/NXOAuth2RequestCallbacks.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// NXOAuth2RequestCallbacks.h
// OAuth2Client
//
// Created by Oleksandr Dodatko on 2/2/15.
// Copyright (c) 2015 nxtbgthng. All rights reserved.
//

#ifndef OAuth2Client_NXOAuth2RequestCallbacks_h
#define OAuth2Client_NXOAuth2RequestCallbacks_h


#import <Foundation/Foundation.h>

typedef void(^NXOAuth2ConnectionResponseHandler)(NSURLResponse *response, NSData *responseData, NSError *error);
typedef void(^NXOAuth2ConnectionSendingProgressHandler)(unsigned long long bytesSend, unsigned long long bytesTotal);


#endif
Loading