Skip to content

Commit 0f7670c

Browse files
committed
fix: re-apply demo-specific code
1 parent 6c4aaee commit 0f7670c

File tree

5 files changed

+48
-3
lines changed

5 files changed

+48
-3
lines changed

Diff for: examples/demo/ios/Podfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -619,4 +619,4 @@ SPEC CHECKSUMS:
619619

620620
PODFILE CHECKSUM: 5778e07dee7c2db582dfe9e0640f1699b51a1b52
621621

622-
COCOAPODS: 1.14.3
622+
COCOAPODS: 1.15.2

Diff for: examples/demo/macos/Example-macOS/AppDelegate.h

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
#import <RCTAppDelegate.h>
21
#import <Cocoa/Cocoa.h>
2+
#import <RCTAppDelegate.h>
3+
#import <React/RCTLinkingManager.h>
4+
#import "RNAppAuthAuthorizationFlowManager.h"
5+
6+
@interface AppDelegate : RCTAppDelegate <RNAppAuthAuthorizationFlowManager>
37

4-
@interface AppDelegate : RCTAppDelegate
8+
@property(nonatomic, weak) id<RNAppAuthAuthorizationFlowManagerDelegate>
9+
authorizationFlowManagerDelegate;
510

611
@end

Diff for: examples/demo/macos/Example-macOS/AppDelegate.mm

+20
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#import "AppDelegate.h"
22

33
#import <React/RCTBundleURLProvider.h>
4+
#import <React/RCTLinkingManager.h>
45

56
@implementation AppDelegate
67

@@ -14,6 +15,25 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification
1415
return [super applicationDidFinishLaunching:notification];
1516
}
1617

18+
- (void)applicationWillFinishLaunching:(NSNotification *)notification {
19+
[[NSAppleEventManager sharedAppleEventManager] setEventHandler:self
20+
andSelector:@selector(getURL:withReplyEvent:)
21+
forEventClass:kInternetEventClass
22+
andEventID:kAEGetURL];
23+
}
24+
25+
- (void)getURL:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)reply
26+
{
27+
NSString* urlString = [[event paramDescriptorForKeyword:keyDirectObject] stringValue];
28+
NSURL *url = [NSURL URLWithString:urlString];
29+
30+
if ([self.authorizationFlowManagerDelegate resumeExternalUserAgentFlowWithURL:url]) {
31+
return;
32+
}
33+
34+
[RCTLinkingManager getUrlEventHandler:event withReplyEvent:reply];
35+
}
36+
1737
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
1838
{
1939
#if DEBUG

Diff for: examples/demo/macos/Example.xcodeproj/project.pbxproj

+2
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,12 @@
232232
);
233233
inputPaths = (
234234
"${PODS_ROOT}/Target Support Files/Pods-Example-macOS/Pods-Example-macOS-resources.sh",
235+
"${PODS_CONFIGURATION_BUILD_DIR}/AppAuth/AppAuthCore_Privacy.bundle",
235236
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
236237
);
237238
name = "[CP] Copy Pods Resources";
238239
outputPaths = (
240+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AppAuthCore_Privacy.bundle",
239241
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
240242
);
241243
runOnlyForDeploymentPostprocessing = 0;

Diff for: examples/demo/macos/Podfile.lock

+18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
PODS:
2+
- AppAuth (1.7.5):
3+
- AppAuth/Core (= 1.7.5)
4+
- AppAuth/ExternalUserAgent (= 1.7.5)
5+
- AppAuth/Core (1.7.5)
6+
- AppAuth/ExternalUserAgent (1.7.5):
7+
- AppAuth/Core
28
- boost (1.76.0)
39
- DoubleConversion (1.1.6)
410
- FBLazyVector (0.72.21)
@@ -285,6 +291,9 @@ PODS:
285291
- React-jsinspector (0.72.21)
286292
- React-logger (0.72.21):
287293
- glog
294+
- react-native-app-auth (7.2.0):
295+
- AppAuth (>= 1.7.3)
296+
- React-Core
288297
- React-NativeModulesApple (0.72.21):
289298
- React-callinvoker
290299
- React-Core
@@ -418,6 +427,7 @@ DEPENDENCIES:
418427
- React-jsiexecutor (from `../node_modules/react-native-macos/ReactCommon/jsiexecutor`)
419428
- React-jsinspector (from `../node_modules/react-native-macos/ReactCommon/jsinspector`)
420429
- React-logger (from `../node_modules/react-native-macos/ReactCommon/logger`)
430+
- react-native-app-auth (from `../../../node_modules/react-native-app-auth`)
421431
- React-NativeModulesApple (from `../node_modules/react-native-macos/ReactCommon/react/nativemodule/core/platform/ios`)
422432
- React-perflogger (from `../node_modules/react-native-macos/ReactCommon/reactperflogger`)
423433
- React-RCTActionSheet (from `../node_modules/react-native-macos/Libraries/ActionSheetIOS`)
@@ -438,6 +448,10 @@ DEPENDENCIES:
438448
- SocketRocket (from `../node_modules/react-native-macos/third-party-podspecs/SocketRocket.podspec`)
439449
- Yoga (from `../node_modules/react-native-macos/ReactCommon/yoga`)
440450

451+
SPEC REPOS:
452+
trunk:
453+
- AppAuth
454+
441455
EXTERNAL SOURCES:
442456
boost:
443457
:podspec: "../node_modules/react-native-macos/third-party-podspecs/boost.podspec"
@@ -481,6 +495,8 @@ EXTERNAL SOURCES:
481495
:path: "../node_modules/react-native-macos/ReactCommon/jsinspector"
482496
React-logger:
483497
:path: "../node_modules/react-native-macos/ReactCommon/logger"
498+
react-native-app-auth:
499+
:path: "../../../node_modules/react-native-app-auth"
484500
React-NativeModulesApple:
485501
:path: "../node_modules/react-native-macos/ReactCommon/react/nativemodule/core/platform/ios"
486502
React-perflogger:
@@ -521,6 +537,7 @@ EXTERNAL SOURCES:
521537
:path: "../node_modules/react-native-macos/ReactCommon/yoga"
522538

523539
SPEC CHECKSUMS:
540+
AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa
524541
boost: dd6670278a62b2597c8aa78da360a2b25563e3f8
525542
DoubleConversion: b27dc0920d7399c3d0135ef9089b1dc4d0403a2a
526543
FBLazyVector: b7481904daa422bb038bde88311486a243362c5f
@@ -542,6 +559,7 @@ SPEC CHECKSUMS:
542559
React-jsiexecutor: e1a79a2f2fd320b9cf42667a2ba967e40050ad18
543560
React-jsinspector: 6851b3495397b5a46e197c5fca264ca2b66a21a6
544561
React-logger: 2f52e784cd5c26387902d49033f0a9983716b9b4
562+
react-native-app-auth: c236808e5f8805f54eca6a2b7d1842af1524de22
545563
React-NativeModulesApple: 6eae63d910ec5b32343113e6c8d76bfd0580311f
546564
React-perflogger: 550b7f2d8b6beea416d9a07e8ce72ac64bca8c00
547565
React-RCTActionSheet: 3a9144f7eb20253530bfc363297e360de1b962a1

0 commit comments

Comments
 (0)