Skip to content
This repository has been archived by the owner on Jul 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #49 from OneDrive/dev
Browse files Browse the repository at this point in the history
release 1.0.5
  • Loading branch information
aclev committed Oct 13, 2015
2 parents c7dcad6 + 830e6fb commit aab8911
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 63 deletions.
32 changes: 24 additions & 8 deletions Examples/iOSExplorer/iOSExplorer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
10007C751B31D88C00E4ED17 /* ADAL_iPad_Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 10007C731B31D88C00E4ED17 /* ADAL_iPad_Storyboard.storyboard */; };
10007C761B31D88C00E4ED17 /* ADAL_iPhone_Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 10007C741B31D88C00E4ED17 /* ADAL_iPhone_Storyboard.storyboard */; };
1003AADC1B0E52460039017A /* ODXActionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1003AADB1B0E52460039017A /* ODXActionController.m */; };
105857821B9A1F8000B71550 /* ODXProgressViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 105857811B9A1F8000B71550 /* ODXProgressViewController.m */; };
106DAAE61AF82DE9001FF917 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 106DAAE51AF82DE9001FF917 /* main.m */; };
Expand All @@ -20,6 +18,8 @@
106DAB3E1AF82E77001FF917 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 106DAB3A1AF82E77001FF917 /* Main.storyboard */; };
106DAB3F1AF82E77001FF917 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 106DAB3C1AF82E77001FF917 /* Images.xcassets */; };
51037E9C92F08CDC45500AAD /* libPods-iOSExplorer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3DFCFC19ED153A38DAF7A55 /* libPods-iOSExplorer.a */; };
96DEE06E1BC5E4F700F02AF8 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 96DEE06A1BC5E4F700F02AF8 /* LaunchScreen.xib */; settings = {ASSET_TAGS = (); }; };
96DEE06F1BC5E4F700F02AF8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96DEE06C1BC5E4F700F02AF8 /* Main.storyboard */; settings = {ASSET_TAGS = (); }; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -35,8 +35,6 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
10007C731B31D88C00E4ED17 /* ADAL_iPad_Storyboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = ADAL_iPad_Storyboard.storyboard; path = ../../../OneDriveSDK/Pods/ADALiOS/ADALiOS/ADALiOS/ADAL_iPad_Storyboard.storyboard; sourceTree = "<group>"; };
10007C741B31D88C00E4ED17 /* ADAL_iPhone_Storyboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = ADAL_iPhone_Storyboard.storyboard; path = ../../../OneDriveSDK/Pods/ADALiOS/ADALiOS/ADALiOS/ADAL_iPhone_Storyboard.storyboard; sourceTree = "<group>"; };
1003AADA1B0E52460039017A /* ODXActionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ODXActionController.h; path = iOSExplorer/ODXActionController.h; sourceTree = SOURCE_ROOT; };
1003AADB1B0E52460039017A /* ODXActionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ODXActionController.m; path = iOSExplorer/ODXActionController.m; sourceTree = SOURCE_ROOT; };
105857801B9A1F8000B71550 /* ODXProgressViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ODXProgressViewController.h; sourceTree = "<group>"; };
Expand All @@ -55,6 +53,8 @@
106DAB391AF82E77001FF917 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = LaunchScreen.xib; sourceTree = "<group>"; };
106DAB3B1AF82E77001FF917 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Main.storyboard; sourceTree = "<group>"; };
106DAB3C1AF82E77001FF917 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
96DEE06B1BC5E4F700F02AF8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
96DEE06D1BC5E4F700F02AF8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
CB0C0620E9767D1127AEF938 /* Pods-iOSExplorer.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iOSExplorer.debug.xcconfig"; path = "Pods/Target Support Files/Pods-iOSExplorer/Pods-iOSExplorer.debug.xcconfig"; sourceTree = "<group>"; };
D3DFCFC19ED153A38DAF7A55 /* libPods-iOSExplorer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-iOSExplorer.a"; sourceTree = BUILT_PRODUCTS_DIR; };
FBDADC01A80AB5DE8181D87E /* Pods-iOSExplorer.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iOSExplorer.release.xcconfig"; path = "Pods/Target Support Files/Pods-iOSExplorer/Pods-iOSExplorer.release.xcconfig"; sourceTree = "<group>"; };
Expand All @@ -75,8 +75,8 @@
10007C721B31D86800E4ED17 /* Resources */ = {
isa = PBXGroup;
children = (
10007C731B31D88C00E4ED17 /* ADAL_iPad_Storyboard.storyboard */,
10007C741B31D88C00E4ED17 /* ADAL_iPhone_Storyboard.storyboard */,
96DEE06A1BC5E4F700F02AF8 /* LaunchScreen.xib */,
96DEE06C1BC5E4F700F02AF8 /* Main.storyboard */,
);
name = Resources;
sourceTree = "<group>";
Expand Down Expand Up @@ -225,10 +225,10 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96DEE06E1BC5E4F700F02AF8 /* LaunchScreen.xib in Resources */,
96DEE06F1BC5E4F700F02AF8 /* Main.storyboard in Resources */,
106DAB3F1AF82E77001FF917 /* Images.xcassets in Resources */,
10007C751B31D88C00E4ED17 /* ADAL_iPad_Storyboard.storyboard in Resources */,
106DAB3D1AF82E77001FF917 /* LaunchScreen.xib in Resources */,
10007C761B31D88C00E4ED17 /* ADAL_iPhone_Storyboard.storyboard in Resources */,
106DAB3E1AF82E77001FF917 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -302,6 +302,22 @@
name = Main.storyboard;
sourceTree = "<group>";
};
96DEE06A1BC5E4F700F02AF8 /* LaunchScreen.xib */ = {
isa = PBXVariantGroup;
children = (
96DEE06B1BC5E4F700F02AF8 /* Base */,
);
name = LaunchScreen.xib;
sourceTree = "<group>";
};
96DEE06C1BC5E4F700F02AF8 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
96DEE06D1BC5E4F700F02AF8 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
Expand Down
16 changes: 8 additions & 8 deletions OneDriveSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Pod::Spec.new do |s|

s.name = "OneDriveSDK"
s.version = "1.0.4"
s.version = "1.0.5"
s.summary = "OneDrive iOS SDK"

s.description = <<-DESC
Expand All @@ -11,7 +11,7 @@ Pod::Spec.new do |s|

s.homepage = "https://dev.onedrive.com"



s.license = { :type => "MIT", :file => "LICENSE.txt" }

Expand All @@ -24,12 +24,12 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/OneDrive/onedrive-sdk-ios.git",
:tag => "#{s.version}"}

s.source_files = "OneDriveSDK/OneDriveSDK/OneDriveSDK.h"
s.public_header_files = "OneDriveSDK/OneDriveSDK/OneDriveSDK.h"
s.source_files = "OneDriveSDK/OneDriveSDK/OneDriveSDK.h"
s.public_header_files = "OneDriveSDK/OneDriveSDK/OneDriveSDK.h"

s.exclude_files = "Examples/*","OneDriveSDK/Test/*"


s.subspec "Common" do |odp|
odp.source_files = "OneDriveSDK/Common/*.{h,m}"
odp.public_header_files = "OneDriveSDK/Common/*.h"
Expand All @@ -38,12 +38,12 @@ Pod::Spec.new do |s|
s.subspec "Implementations" do |usm|
usm.dependency 'OneDriveSDK/Common'
usm.source_files = "OneDriveSDK/OneDriveSDK/ODURLSessionManager/*{h,m}", "OneDriveSDK/OneDriveSDK/*{h,m}"
usm.public_header_files = "OneDriveSDK/OneDriveSDK/**/*.h"
usm.public_header_files = "OneDriveSDK/OneDriveSDK/**/*.h"
end


s.subspec "Auth" do |oda|
oda.dependency 'ADALiOS', '~> 1.0.2'
oda.dependency 'ADALiOS', '~> 1.2.4'
oda.dependency 'OneDriveSDK/Common'

oda.source_files = "OneDriveSDK/Auth/*.{h,m}", "OneDriveSDK/Accounts/*.{h,m}"
Expand All @@ -56,7 +56,7 @@ Pod::Spec.new do |s|

core.source_files = "OneDriveSDK/OneDriveCoreSDK/**/*.{h,m}"
core.public_header_files = "OneDriveSDK/OneDriveCoreSDK/**/*.h"

end

s.subspec "Extensions" do |ext|
Expand Down
6 changes: 3 additions & 3 deletions OneDriveSDK/Accounts/ODServiceInfoProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ @interface ODServiceInfoProvider()
@implementation ODServiceInfoProvider

- (void)getServiceInfoWithViewController:(UIViewController *)viewController
appConfiguration:(ODAppConfiguration *)appConfig
completion:(disambiguationCompletion)completionHandler;
appConfiguration:(ODAppConfiguration *)appConfig
completion:(disambiguationCompletion)completionHandler;
{
NSParameterAssert(viewController);
NSParameterAssert(appConfig);
Expand Down Expand Up @@ -70,7 +70,7 @@ - (void)getServiceInfoWithViewController:(UIViewController *)viewController
}];
dispatch_async(dispatch_get_main_queue(), ^(){
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:discoveryViewController];
navController.modalPresentationStyle = UIModalPresentationFormSheet;
navController.modalPresentationStyle = viewController.modalPresentationStyle;
UIViewController *viewControllerToPresentOn = viewController;
while (viewControllerToPresentOn.presentedViewController) {
viewControllerToPresentOn = viewControllerToPresentOn.presentedViewController;
Expand Down
26 changes: 17 additions & 9 deletions OneDriveSDK/Auth/ODBaseAuthProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,28 @@ - (instancetype)initWithServiceInfo:(ODServiceInfo *)serviceInfo

- (void) authenticateWithViewController:(UIViewController *)viewController completion:(void (^)(NSError *error))completionHandler;
{
// if the view controller is an ODAuthenticationViewController we just want to redirect to a new URL
// Get the view controller on the top of the stack
UIViewController *presentingViewController = [viewController childViewControllers][0];
// if the view controller's child is an ODAuthenticationViewController we just want to redirect to a new URL
// not push another view controller
if ([viewController respondsToSelector:@selector(redirectWithStartURL:endURL:success:)]){
__block ODAuthenticationViewController *authViewController = (ODAuthenticationViewController *)viewController;
if (presentingViewController && [presentingViewController respondsToSelector:@selector(redirectWithStartURL:endURL:success:)]){
__block ODAuthenticationViewController *authViewController = (ODAuthenticationViewController *)presentingViewController;
NSURL *authURL = [self authURL];
[self.logger logWithLevel:ODLogDebug message:@"Authentication URL : %@", authURL];
[authViewController redirectWithStartURL:authURL
endURL:[NSURL URLWithString:self.serviceInfo.redirectURL]
success:^(NSURL *endURL, NSError *error){
[self authorizationFlowCompletedWithURL:endURL
error:error
presentingViewControlelr:authViewController
presentingViewControlelr:presentingViewController
completion:completionHandler];
}];
}
else {
__block ODAuthenticationViewController *authViewController =
[[ODAuthenticationViewController alloc] initWithStartURL:[self authURL]
endURL:[NSURL URLWithString:self.serviceInfo.redirectURL]
success:^(NSURL *endURL, NSError *error){
endURL:[NSURL URLWithString:self.serviceInfo.redirectURL]
success:^(NSURL *endURL, NSError *error){
[self authorizationFlowCompletedWithURL:endURL
error:error
presentingViewControlelr:authViewController
Expand All @@ -75,8 +77,14 @@ - (void) authenticateWithViewController:(UIViewController *)viewController compl
}];
dispatch_async(dispatch_get_main_queue(), ^{
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:authViewController];
UIViewController *parentViewController = viewController;
[parentViewController presentViewController:navController animated:YES completion:nil];
navController.modalPresentationStyle = viewController.modalPresentationStyle;
UIViewController *viewControllerToPresentOn = viewController;
while (viewControllerToPresentOn.presentedViewController) {
viewControllerToPresentOn = viewControllerToPresentOn.presentedViewController;
}
[viewControllerToPresentOn presentViewController:navController animated:YES completion:^{
[authViewController loadInitialRequest];
}];
});
}
}
Expand All @@ -88,7 +96,7 @@ - (void)authorizationFlowCompletedWithURL:(NSURL *)endURL
{
// Always remove the auth view when we finished loading.
dispatch_async(dispatch_get_main_queue(), ^{
[presentingViewController dismissViewControllerAnimated:YES completion:nil];
[presentingViewController dismissViewControllerAnimated:NO completion:nil];
});

if (!error){
Expand Down
11 changes: 11 additions & 0 deletions OneDriveSDK/Auth/ODBusinessAuthProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#import "ODAuthConstants.h"
#import "ODAccountSession.h"
#import "ODAADAccountBridge.h"
#import "ODAuthenticationViewController.h"

@interface ODBusinessAuthProvider(){
@private
Expand All @@ -41,6 +42,16 @@ @implementation ODBusinessAuthProvider
- (void) authenticateWithViewController:(UIViewController*)viewController completion:(void (^)(NSError *error))completionHandler
{
self.authContext.parentController = viewController;
// If the disambiguation page is still being displayed remove it from the view
if (self.authContext.parentController){
UIViewController *childViewController = [viewController childViewControllers][0];
if (childViewController && [childViewController respondsToSelector:@selector(redirectWithStartURL:endURL:success:)]){
self.authContext.parentController = viewController.presentingViewController;
dispatch_async(dispatch_get_main_queue(), ^{
[childViewController dismissViewControllerAnimated:NO completion:nil];
});
}
}
[self.authContext acquireTokenWithResource:self.serviceInfo.resourceId
clientId:self.serviceInfo.appId
redirectUri:[NSURL URLWithString:self.serviceInfo.redirectURL]
Expand Down
2 changes: 1 addition & 1 deletion OneDriveSDK/Extensions/ODClient+Authentication.m
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ - (void)authenticateWithAppConfig:(ODAppConfiguration *)appConfig
[self authenticateWithAuthProvider:authProvider
httpProvider:appConfig.httpProvider
logger:appConfig.logger
viewController:presentedViewController
viewController:presentedViewController.parentViewController
completion:completion];
}
else {
Expand Down
2 changes: 1 addition & 1 deletion OneDriveSDK/OneDriveCoreSDK/Core/ODConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
NSString *const ODHeaderContentType = @"Content-Type";
NSString *const ODHeaderApplicationJson = @"application/json";
NSString *const ODHeaderRespondAsync = @"respond-async";
NSString *const ODSDKVersion = @"1.0.4";
NSString *const ODSDKVersion = @"1.0.5";
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OneDrive iOS SDK
# Get started with the OneDrive SDK for iOS

[![Build Status](https://travis-ci.org/OneDrive/onedrive-sdk-ios.svg?branch=master)](https://travis-ci.org/OneDrive/onedrive-sdk-ios)

Expand All @@ -25,7 +25,7 @@ If you are targeting iOS 9 with XCode 7, you need to temporarily enable PFS exce

To do this, add the following to your Info.plist :

```
```xml
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
Expand Down Expand Up @@ -66,7 +66,7 @@ These domains enable MSA and standard AAD authentication. It's possible that an

**Warning** This it not the recommended approach and is only necessary if you wish to target all tenants that do not use standard AAD authentication and do not support Transport Layer Security v1.2.

```
```xml
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowArbitraryLoads</key>
Expand Down
14 changes: 7 additions & 7 deletions docs/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ To authenticate your app to use OneDrive, you only need to get a ODClient, which
## Simple authentication
The easiest way to get authenticated is to call the clientWithCompletion method:

```
```objc
[ODClient clientWithCompletion:^(ODClient *client, NSError *error){
if (!error){
self.odClient = client;
Expand All @@ -22,7 +22,7 @@ If there was an error in either of these steps, the error will be returned.
If you want to invoke the UI, you can make a direct call to authenticatedClientWithCompletion:
```
```objc
[ODClient authenticatedClientWithCompletion:(ODClient *client, NSError *error){
if (!error){
self.odclient = client;
Expand All @@ -35,27 +35,27 @@ This method will work like clientWithCompletion but it will not check the disk f

If you already have accounts on the disk and want to select which account to use, you can call:

```
```objc
NSArray *accounts = [ODClient loadClients];
```

This method will return an `NSArray` of ODClient objects that have been stored on disk.

If you want to load just the current account. You can also call:

```
```objc
ODClient *currentClient = [ODClient loadCurrentClient];
```

You can set the current client by:

```
```objc
[ODClient setCurrentClient:<current_client>];
```
To load the client by the client's account id:
```
```objc
[ODClient loadClientWithAccountId:<account_id>];
```

Expand All @@ -65,7 +65,7 @@ To get a client's account id, use the `client.accountId` property on ODClient.

To sign out you can call:

```
```objc
[currentClient signOutWithCompletion:^(NSError *error){
// This will remove any client information from disk.
// An error will be passed back if an error occured during the sign out process.
Expand Down
Loading

0 comments on commit aab8911

Please sign in to comment.