Skip to content

Commit

Permalink
fix: re-apply demo-specific code
Browse files Browse the repository at this point in the history
  • Loading branch information
shirakaba committed Oct 30, 2024
1 parent d7f3c41 commit a9ddf95
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/demo/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -619,4 +619,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 5778e07dee7c2db582dfe9e0640f1699b51a1b52

COCOAPODS: 1.14.3
COCOAPODS: 1.15.2
9 changes: 7 additions & 2 deletions examples/demo/macos/Example-macOS/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#import <RCTAppDelegate.h>
#import <Cocoa/Cocoa.h>
#import <RCTAppDelegate.h>
#import <React/RCTLinkingManager.h>
#import "RNAppAuthAuthorizationFlowManager.h"

@interface AppDelegate : RCTAppDelegate <RNAppAuthAuthorizationFlowManager>

@interface AppDelegate : RCTAppDelegate
@property(nonatomic, weak) id<RNAppAuthAuthorizationFlowManagerDelegate>
authorizationFlowManagerDelegate;

@end
20 changes: 20 additions & 0 deletions examples/demo/macos/Example-macOS/AppDelegate.mm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#import "AppDelegate.h"

#import <React/RCTBundleURLProvider.h>
#import <React/RCTLinkingManager.h>

@implementation AppDelegate

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

- (void)applicationWillFinishLaunching:(NSNotification *)notification {
[[NSAppleEventManager sharedAppleEventManager] setEventHandler:self
andSelector:@selector(getURL:withReplyEvent:)
forEventClass:kInternetEventClass
andEventID:kAEGetURL];
}

- (void)getURL:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)reply
{
NSString* urlString = [[event paramDescriptorForKeyword:keyDirectObject] stringValue];
NSURL *url = [NSURL URLWithString:urlString];

if ([self.authorizationFlowManagerDelegate resumeExternalUserAgentFlowWithURL:url]) {
return;
}

[RCTLinkingManager getUrlEventHandler:event withReplyEvent:reply];
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
Expand Down
2 changes: 2 additions & 0 deletions examples/demo/macos/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,12 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Example-macOS/Pods-Example-macOS-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/AppAuth/AppAuthCore_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AppAuthCore_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
18 changes: 18 additions & 0 deletions examples/demo/macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
PODS:
- AppAuth (1.7.5):
- AppAuth/Core (= 1.7.5)
- AppAuth/ExternalUserAgent (= 1.7.5)
- AppAuth/Core (1.7.5)
- AppAuth/ExternalUserAgent (1.7.5):
- AppAuth/Core
- boost (1.76.0)
- DoubleConversion (1.1.6)
- FBLazyVector (0.72.21)
Expand Down Expand Up @@ -285,6 +291,9 @@ PODS:
- React-jsinspector (0.72.21)
- React-logger (0.72.21):
- glog
- react-native-app-auth (7.2.0):
- AppAuth (>= 1.7.3)
- React-Core
- React-NativeModulesApple (0.72.21):
- React-callinvoker
- React-Core
Expand Down Expand Up @@ -418,6 +427,7 @@ DEPENDENCIES:
- React-jsiexecutor (from `../node_modules/react-native-macos/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native-macos/ReactCommon/jsinspector`)
- React-logger (from `../node_modules/react-native-macos/ReactCommon/logger`)
- react-native-app-auth (from `../../../node_modules/react-native-app-auth`)
- React-NativeModulesApple (from `../node_modules/react-native-macos/ReactCommon/react/nativemodule/core/platform/ios`)
- React-perflogger (from `../node_modules/react-native-macos/ReactCommon/reactperflogger`)
- React-RCTActionSheet (from `../node_modules/react-native-macos/Libraries/ActionSheetIOS`)
Expand All @@ -438,6 +448,10 @@ DEPENDENCIES:
- SocketRocket (from `../node_modules/react-native-macos/third-party-podspecs/SocketRocket.podspec`)
- Yoga (from `../node_modules/react-native-macos/ReactCommon/yoga`)

SPEC REPOS:
trunk:
- AppAuth

EXTERNAL SOURCES:
boost:
:podspec: "../node_modules/react-native-macos/third-party-podspecs/boost.podspec"
Expand Down Expand Up @@ -481,6 +495,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-macos/ReactCommon/jsinspector"
React-logger:
:path: "../node_modules/react-native-macos/ReactCommon/logger"
react-native-app-auth:
:path: "../../../node_modules/react-native-app-auth"
React-NativeModulesApple:
:path: "../node_modules/react-native-macos/ReactCommon/react/nativemodule/core/platform/ios"
React-perflogger:
Expand Down Expand Up @@ -521,6 +537,7 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-macos/ReactCommon/yoga"

SPEC CHECKSUMS:
AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa
boost: dd6670278a62b2597c8aa78da360a2b25563e3f8
DoubleConversion: b27dc0920d7399c3d0135ef9089b1dc4d0403a2a
FBLazyVector: b7481904daa422bb038bde88311486a243362c5f
Expand All @@ -542,6 +559,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: e1a79a2f2fd320b9cf42667a2ba967e40050ad18
React-jsinspector: 6851b3495397b5a46e197c5fca264ca2b66a21a6
React-logger: 2f52e784cd5c26387902d49033f0a9983716b9b4
react-native-app-auth: c236808e5f8805f54eca6a2b7d1842af1524de22
React-NativeModulesApple: 6eae63d910ec5b32343113e6c8d76bfd0580311f
React-perflogger: 550b7f2d8b6beea416d9a07e8ce72ac64bca8c00
React-RCTActionSheet: 3a9144f7eb20253530bfc363297e360de1b962a1
Expand Down

0 comments on commit a9ddf95

Please sign in to comment.