Skip to content

Commit

Permalink
Update samples and docs to not use or reference deprecated APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamDenniss committed Jul 13, 2018
1 parent 971d2dc commit 619bb7c
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Examples/Example-iOS_ObjC-Carthage/Source/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
#import <UIKit/UIKit.h>

@protocol OIDAuthorizationFlowSession;
@protocol OIDExternalUserAgentSession;

/*! @brief The example application's delegate.
*/
Expand All @@ -32,7 +32,7 @@
incoming URL on UIApplicationDelegate.application:openURL:options:. This property will be
nil, except when an authorization flow is in progress.
*/
@property(nonatomic, strong, nullable) id<OIDAuthorizationFlowSession> currentAuthorizationFlow;
@property(nonatomic, strong, nullable) id<OIDExternalUserAgentSession> currentAuthorizationFlow;

@end

2 changes: 1 addition & 1 deletion Examples/Example-iOS_ObjC-Carthage/Source/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ - (BOOL)application:(UIApplication *)app
options:(NSDictionary<NSString *, id> *)options {
// Sends the URL to the current authorization flow (if any) which will process it if it relates to
// an authorization response.
if ([_currentAuthorizationFlow resumeAuthorizationFlowWithURL:url]) {
if ([_currentAuthorizationFlow resumeExternalUserAgentFlowWithURL:url]) {
_currentAuthorizationFlow = nil;
return YES;
}
Expand Down
4 changes: 2 additions & 2 deletions Examples/Example-iOS_ObjC/Source/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
#import <UIKit/UIKit.h>

@protocol OIDAuthorizationFlowSession;
@protocol OIDExternalUserAgentSession;

/*! @brief The example application's delegate.
*/
Expand All @@ -32,7 +32,7 @@
incoming URL on UIApplicationDelegate.application:openURL:options:. This property will be
nil, except when an authorization flow is in progress.
*/
@property(nonatomic, strong, nullable) id<OIDAuthorizationFlowSession> currentAuthorizationFlow;
@property(nonatomic, strong, nullable) id<OIDExternalUserAgentSession> currentAuthorizationFlow;

@end

2 changes: 1 addition & 1 deletion Examples/Example-iOS_ObjC/Source/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ - (BOOL)application:(UIApplication *)app
options:(NSDictionary<NSString *, id> *)options {
// Sends the URL to the current authorization flow (if any) which will process it if it relates to
// an authorization response.
if ([_currentAuthorizationFlow resumeAuthorizationFlowWithURL:url]) {
if ([_currentAuthorizationFlow resumeExternalUserAgentFlowWithURL:url]) {
_currentAuthorizationFlow = nil;
return YES;
}
Expand Down
4 changes: 2 additions & 2 deletions Examples/Example-iOS_Swift-Carthage/Source/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?
var currentAuthorizationFlow: OIDAuthorizationFlowSession?
var currentAuthorizationFlow: OIDExternalUserAgentSession?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
Expand All @@ -32,7 +32,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {

if let authorizationFlow = self.currentAuthorizationFlow, authorizationFlow.resumeAuthorizationFlow(with: url) {
if let authorizationFlow = self.currentAuthorizationFlow, authorizationFlow.resumeExternalUserAgentFlow(with: url) {
self.currentAuthorizationFlow = nil
return true
}
Expand Down
6 changes: 3 additions & 3 deletions Examples/Example-macOS/Source/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@

NS_ASSUME_NONNULL_BEGIN

@protocol OIDAuthorizationFlowSession;
@protocol OIDExternalUserAgentSession;

/*! @class AppDelegate
@brief The example application's delegate.
*/
@interface AppDelegate : NSObject <NSApplicationDelegate> {
// property variables
NSWindow *_window;
id<OIDAuthorizationFlowSession> _currentAuthorizationFlow;
id<OIDExternalUserAgentSession> _currentAuthorizationFlow;
}

/*! @property currentAuthorizationFlow
@brief The authorization flow session which receives the return URL from the browser.
@discussion We need to store this in the app delegate as it's that delegate which receives the
incoming URL. This property will be nil, except when an authorization flow is in progress.
*/
@property(nonatomic, strong, nullable) id<OIDAuthorizationFlowSession> currentAuthorizationFlow;
@property(nonatomic, strong, nullable) id<OIDExternalUserAgentSession> currentAuthorizationFlow;

@property(nullable) IBOutlet NSWindow *window;

Expand Down
2 changes: 1 addition & 1 deletion Examples/Example-macOS/Source/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ - (void)handleGetURLEvent:(NSAppleEventDescriptor *)event
withReplyEvent:(NSAppleEventDescriptor *)replyEvent {
NSString *URLString = [[event paramDescriptorForKeyword:keyDirectObject] stringValue];
NSURL *URL = [NSURL URLWithString:URLString];
[_currentAuthorizationFlow resumeAuthorizationFlowWithURL:URL];
[_currentAuthorizationFlow resumeExternalUserAgentFlowWithURL:URL];
}

@end
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ order to continue the authorization flow from the redirect.
```objc
// property of the app's AppDelegate
@property(nonatomic, strong, nullable)
id<OIDAuthorizationFlowSession> currentAuthorizationFlow;
id<OIDExternalUserAgentSession> currentAuthorizationFlow;
```

And your main class, a property to store the auth state:
Expand Down Expand Up @@ -224,7 +224,7 @@ authorization session (created in the previous session).
options:(NSDictionary<NSString *, id> *)options {
// Sends the URL to the current authorization flow (if any) which will
// process it if it relates to an authorization response.
if ([_currentAuthorizationFlow resumeAuthorizationFlowWithURL:url]) {
if ([_currentAuthorizationFlow resumeExternalUserAgentFlowWithURL:url]) {
_currentAuthorizationFlow = nil;
return YES;
}
Expand Down

0 comments on commit 619bb7c

Please sign in to comment.