Skip to content
This repository has been archived by the owner on Dec 9, 2021. It is now read-only.

Commit

Permalink
Finish OAuth for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
se-bastiaan committed Oct 25, 2020
1 parent d64d041 commit 1f783d5
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 17 deletions.
10 changes: 4 additions & 6 deletions ios/ThaliApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@
2D02E4901E0B4A5D006451C7 /* ThaliApp-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ThaliApp-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
2F1107B2451978230CDD0198 /* Pods-ThaliApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ThaliApp.release.xcconfig"; path = "Target Support Files/Pods-ThaliApp/Pods-ThaliApp.release.xcconfig"; sourceTree = "<group>"; };
327170882530FCBE00742C9A /* LaunchScreen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = LaunchScreen.xib; path = ThaliApp/LaunchScreen.xib; sourceTree = "<group>"; };
3296B7552530F1CE00A5FDF7 /* ThaliAppDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = ThaliAppDebug.entitlements; path = ThaliApp/ThaliAppDebug.entitlements; sourceTree = "<group>"; };
329872062545E40A00289767 /* ThaliApp.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; name = ThaliApp.entitlements; path = ThaliApp/ThaliApp.entitlements; sourceTree = "<group>"; };
469C2F6B25207AD000F8B3BE /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
469C302C2520999900F8B3BE /* ThaliAppRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = ThaliAppRelease.entitlements; path = ThaliApp/ThaliAppRelease.entitlements; sourceTree = "<group>"; };
521300258F0CDF8B3D54C220 /* Pods-ThaliApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ThaliApp.debug.xcconfig"; path = "Target Support Files/Pods-ThaliApp/Pods-ThaliApp.debug.xcconfig"; sourceTree = "<group>"; };
C2D9C10259285A7469D1F115 /* libPods-ThaliApp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ThaliApp.a"; sourceTree = BUILT_PRODUCTS_DIR; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -119,9 +118,8 @@
13B07FAE1A68108700A75B9A /* ThaliApp */ = {
isa = PBXGroup;
children = (
329872062545E40A00289767 /* ThaliApp.entitlements */,
327170882530FCBE00742C9A /* LaunchScreen.xib */,
3296B7552530F1CE00A5FDF7 /* ThaliAppDebug.entitlements */,
469C302C2520999900F8B3BE /* ThaliAppRelease.entitlements */,
469C2F6B25207AD000F8B3BE /* GoogleService-Info.plist */,
008F07F21AC5B25A0029DE68 /* main.jsbundle */,
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
Expand Down Expand Up @@ -641,7 +639,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-Dev";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = ThaliApp/ThaliAppDebug.entitlements;
CODE_SIGN_ENTITLEMENTS = ThaliApp/ThaliApp.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
Expand Down Expand Up @@ -684,7 +682,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = ThaliApp/ThaliAppRelease.entitlements;
CODE_SIGN_ENTITLEMENTS = ThaliApp/ThaliApp.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
Expand Down
5 changes: 4 additions & 1 deletion ios/ThaliApp/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#import <React/RCTBridgeDelegate.h>
#import <UIKit/UIKit.h>
#import "RNAppAuthAuthorizationFlowManager.h"

@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate, RNAppAuthAuthorizationFlowManager>

@property (nonatomic, strong) UIWindow *window;

@property(nonatomic, weak)id<RNAppAuthAuthorizationFlowManagerDelegate>authorizationFlowManagerDelegate;

@end
13 changes: 11 additions & 2 deletions ios/ThaliApp/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,23 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
if (self.authorizationFlowManagerDelegate) {
if ([self.authorizationFlowManagerDelegate resumeExternalUserAgentFlowWithURL:url]) {
return YES;
}
}
return [RCTLinkingManager application:application openURL:url
sourceApplication:sourceApplication annotation:annotation];
}

// Only if your app is using [Universal Links](https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html).
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
{
if (self.authorizationFlowManagerDelegate) {
if ([self.authorizationFlowManagerDelegate resumeExternalUserAgentFlowWithURL:userActivity.webpageURL]) {
return YES;
}
}
return [RCTLinkingManager application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler];
Expand Down
11 changes: 11 additions & 0 deletions ios/ThaliApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.thaliapp</string>
<key>CFBundleURLSchemes</key>
<array>
<string>nu.thalia</string>
</array>
</dict>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand Down
8 changes: 0 additions & 8 deletions ios/ThaliApp/ThaliAppDebug.entitlements

This file was deleted.

0 comments on commit 1f783d5

Please sign in to comment.