diff --git a/Podfile.lock b/Podfile.lock index 31bcd0a1b..804a148c7 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -38,7 +38,7 @@ PODS: - PromiseKit/CorePromise - PromiseKit/UIKit (6.13.1): - PromiseKit/CorePromise - - PureLayout (3.1.6) + - PureLayout (3.1.8) - Reachability (3.2) - SAMKeychain (1.5.3) - SignalCoreKit (1.0.0): @@ -129,7 +129,7 @@ DEPENDENCIES: - Mantle (from `https://github.com/signalapp/Mantle`, branch `signal-master`) - NVActivityIndicatorView - PromiseKit - - PureLayout (~> 3.1.4) + - PureLayout (~> 3.1.8) - Reachability - SAMKeychain - SignalCoreKit (from `https://github.com/signalapp/SignalCoreKit.git`) @@ -197,7 +197,7 @@ SPEC CHECKSUMS: Mantle: 2fa750afa478cd625a94230fbf1c13462f29395b NVActivityIndicatorView: 738e843cb8924e9e4fc3e559d0728031624bf860 PromiseKit: 28fda91c973cc377875d8c0ea4f973013c05b6db - PureLayout: bd3c4ec3a3819ad387c99ebb72c6b129c3ed4d2d + PureLayout: a4afb3d79dd958564ce33d22c89f407280d8e6a8 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 SAMKeychain: 483e1c9f32984d50ca961e26818a534283b4cd5c SignalCoreKit: 4562b2bbd9830077439ca003f952a798457d4ea5 @@ -208,6 +208,6 @@ SPEC CHECKSUMS: YYImage: 6db68da66f20d9f169ceb94dfb9947c3867b9665 ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb -PODFILE CHECKSUM: 523f27e57b63690fcbf629f49664dabac3876654 +PODFILE CHECKSUM: 50e6a35c838ba28d2ee02bc6018fdd297c04e55f COCOAPODS: 1.10.1 diff --git a/Session/DMs/NewDMVC.swift b/Session/DMs/NewDMVC.swift index 426d387aa..c6ff34141 100644 --- a/Session/DMs/NewDMVC.swift +++ b/Session/DMs/NewDMVC.swift @@ -38,6 +38,19 @@ final class NewDMVC : BaseVC, UIPageViewControllerDataSource, UIPageViewControll return result }() + init(sessionID: String) { + super.init(nibName: nil, bundle: nil) + enterPublicKeyVC.setSessionID(to: sessionID) + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + } + + override init(nibName: String?, bundle: Bundle?) { + super.init(nibName: nibName, bundle: bundle) + } + // MARK: Lifecycle override func viewDidLoad() { super.viewDidLoad() @@ -260,6 +273,10 @@ private final class EnterPublicKeyVC : UIViewController { } // MARK: General + func setSessionID(to sessionID: String){ + publicKeyTextView.text = sessionID + } + func constrainHeight(to height: CGFloat) { view.set(.height, to: height) } diff --git a/Session/Home/HomeVC.swift b/Session/Home/HomeVC.swift index b9c5bf24d..de966618f 100644 --- a/Session/Home/HomeVC.swift +++ b/Session/Home/HomeVC.swift @@ -385,11 +385,7 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, NewConv } else if let thread = thread as? TSGroupThread, thread.isClosedGroup == true { let groupID = thread.groupModel.groupId let groupPublicKey = LKGroupUtilities.getDecodedGroupID(groupID) - do { - try MessageSender.leave(groupPublicKey, using: transaction) - } catch { - // TODO: Handle - } + MessageSender.leave(groupPublicKey, using: transaction).retainUntilComplete() thread.removeAllThreadInteractions(with: transaction) thread.remove(with: transaction) } else { @@ -423,6 +419,13 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, NewConv present(navigationController, animated: true, completion: nil) } + @objc(createNewDMFromDeepLink:) + func createNewDMFromDeepLink(sessionID: String) { + let newDMVC = NewDMVC(sessionID: sessionID) + let navigationController = OWSNavigationController(rootViewController: newDMVC) + present(navigationController, animated: true, completion: nil) + } + @objc func createClosedGroup() { let newClosedGroupVC = NewClosedGroupVC() let navigationController = OWSNavigationController(rootViewController: newClosedGroupVC) diff --git a/Session/Meta/AppDelegate.m b/Session/Meta/AppDelegate.m index 5fc09cfcf..8b056a529 100644 --- a/Session/Meta/AppDelegate.m +++ b/Session/Meta/AppDelegate.m @@ -789,4 +789,38 @@ static NSTimeInterval launchStartedAt; }]; } +# pragma mark - App Link + +- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options +{ + NSURLComponents *components = [[NSURLComponents alloc] initWithURL:url resolvingAgainstBaseURL:true]; + + // URL Scheme is sessionmessenger://DM?sessionID=1234 + // We can later add more parameters like message etc. + NSString *intent = components.host; + if (intent != nil && [intent isEqualToString:@"DM"]) { + NSArray *params = [components queryItems]; + NSPredicate *sessionIDPredicate = [NSPredicate predicateWithFormat:@"name == %@", @"sessionID"]; + NSArray *matches = [params filteredArrayUsingPredicate:sessionIDPredicate]; + if (matches.count > 0) { + NSString *sessionID = matches.firstObject.value; + [self createNewDMFromDeepLink:sessionID]; + return YES; + } + } + return NO; +} + +- (void)createNewDMFromDeepLink:(NSString *)sessionID +{ + UIViewController *viewController = self.window.rootViewController; + if ([viewController class] == [OWSNavigationController class]) { + UIViewController *visibleVC = ((OWSNavigationController *)viewController).visibleViewController; + if ([visibleVC isKindOfClass:HomeVC.class]) { + HomeVC *homeVC = (HomeVC *)visibleVC; + [homeVC createNewDMFromDeepLink:sessionID]; + } + } +} + @end diff --git a/Session/Meta/Session-Info.plist b/Session/Meta/Session-Info.plist index 9ca1ef53b..55fb6700d 100644 --- a/Session/Meta/Session-Info.plist +++ b/Session/Meta/Session-Info.plist @@ -2,8 +2,6 @@ - PHPhotoLibraryPreventAutomaticLimitedAccessAlert - BuildDetails CarthageVersion @@ -11,27 +9,6 @@ OSXVersion 10.15.6 - NSAppTransportSecurity - - NSExceptionDomains - - public.loki.foundation - - NSExceptionRequiresForwardSecrecy - - - storage.seed1.loki.network - - NSExceptionRequiresForwardSecrecy - - - storage.seed3.loki.network - - NSExceptionRequiresForwardSecrecy - - - - CFBundleDevelopmentRegion en CFBundleDisplayName @@ -66,6 +43,16 @@ sgnl + + CFBundleTypeRole + Viewer + CFBundleURLName + org.getsession + CFBundleURLSchemes + + sessionmessenger + + CFBundleVersion $(CURRENT_PROJECT_VERSION) @@ -75,6 +62,27 @@ public.app-category.social-networking LSRequiresIPhoneOS + NSAppTransportSecurity + + NSExceptionDomains + + public.loki.foundation + + NSExceptionRequiresForwardSecrecy + + + storage.seed1.loki.network + + NSExceptionRequiresForwardSecrecy + + + storage.seed3.loki.network + + NSExceptionRequiresForwardSecrecy + + + + NSAppleMusicUsageDescription Signal needs to use Apple Music to play media attachments. NSCameraUsageDescription @@ -82,13 +90,15 @@ NSContactsUsageDescription Signal uses your contacts to find users you know. We do not store your contacts on the server. NSFaceIDUsageDescription - Session's Screen Lock feature uses Face ID. + Session's Screen Lock feature uses Face ID. NSMicrophoneUsageDescription Session needs access to your microphone to record media. NSPhotoLibraryAddUsageDescription Session needs access to your library to save photos. NSPhotoLibraryUsageDescription Session needs access to your library to send photos. + PHPhotoLibraryPreventAutomaticLimitedAccessAlert + UIAppFonts ElegantIcons.ttf