Skip to content

Release v3.3.4 #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ in case of vulnerabilities.

## [Unreleased]

## [3.3.4] - 2020-01-07

### Fixed
- Disable swipe to dismiss gesture for modal by [@frankyjuang](https://github.com/frankyjuang) ([#134](https://github.com/proyecto26/react-native-inappbrowser/pull/134)).

## [3.3.3] - 2019-11-25

### Fixed
- Remove build warnings with **iOS** 13 using [Pragmas](https://clang.llvm.org/docs/UsersManual.html#controlling-diagnostics-via-pragmas).

## [3.3.2] - 2019-11-15

### Fixed
Expand Down Expand Up @@ -135,7 +145,9 @@ Missing tags for previous versions 🤷‍♂
- Fix `EventBusException` on **Android** by [@Almouro](https://github.com/Almouro) ([9cf4cbb](https://github.com/proyecto26/react-native-inappbrowser/commit/9cf4cbb58d55c8b534dabac6791e6a2a5428253f)).


[Unreleased]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.3.2...HEAD
[Unreleased]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.3.4...HEAD
[3.3.4]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.3.3...v3.3.4
[3.3.3]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.3.2...v3.3.3
[3.3.2]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.3.1...v3.3.2
[3.3.1]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.3.0...v3.3.1
[3.3.0]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.2.0...v3.3.0
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ import InAppBrowser from 'react-native-inappbrowser-reborn'

### Authentication Flow using Deep Linking

Define your app scheme and replace `my-scheme` and `my-host` with your info.
In order to redirect back to your application from a web browser, you must specify a unique URI to your app. To do this,
define your app scheme and replace `my-scheme` and `my-host` with your info.

- Enable deep linking (Android) - **[AndroidManifest.xml](https://github.com/proyecto26/react-native-inappbrowser/blob/master/example/android/app/src/main/AndroidManifest.xml#L23)**
```
Expand Down
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ PODS:
- React-RCTWebSocket (0.60.0):
- React-Core (= 0.60.0)
- React-fishhook (= 0.60.0)
- RNInAppBrowser (3.0.0):
- RNInAppBrowser (3.3.3):
- React
- yoga (0.60.0.React)

Expand Down Expand Up @@ -111,7 +111,7 @@ DEPENDENCIES:
- yoga (from `../node_modules/react-native/ReactCommon/yoga`)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
https://github.com/CocoaPods/Specs.git:
- boost-for-react-native

EXTERNAL SOURCES:
Expand Down Expand Up @@ -185,9 +185,9 @@ SPEC CHECKSUMS:
React-RCTText: 685fca2e13b024271048e7e247ef24476f28a41e
React-RCTVibration: 4ee1cf208ab17a50fafb1c16ffe28fe594a64e4f
React-RCTWebSocket: fca087d583724aa0e5fef7d911f0f2a28d0f2736
RNInAppBrowser: 5bf209eafe43a1de18b81125ed1f9f5702b2ec1a
RNInAppBrowser: 0800f17fd7ed9fc503eb68e427befebb41ee719b
yoga: 616fde658be980aa60a2158835170f3f9c2d04b4

PODFILE CHECKSUM: e6321daab2a139195c1bcaad4b674c568140b44a

COCOAPODS: 1.7.3
COCOAPODS: 1.8.0
104 changes: 52 additions & 52 deletions example/ios/example.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions ios/RNInAppBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@
#endif

@interface RNInAppBrowser : NSObject <RCTBridgeModule>
@end

@interface ModalSafariViewController : UINavigationController <UINavigationControllerDelegate>
@end
@end
84 changes: 30 additions & 54 deletions ios/RNInAppBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,63 +15,28 @@
#import <AuthenticationServices/AuthenticationServices.h>
#endif

#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_13_0
@interface RNInAppBrowser () <SFSafariViewControllerDelegate, UIAdaptivePresentationControllerDelegate>
@end
#else
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
@interface RNInAppBrowser () <SFSafariViewControllerDelegate, ASWebAuthenticationPresentationContextProviding, UIAdaptivePresentationControllerDelegate>
@end
#endif

@interface ModalSafariViewController () <UINavigationControllerDelegate>
@end

@implementation ModalSafariViewController

- (void)viewDidLoad {
[super viewDidLoad];
}

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
}

- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotate {
return YES;
}

#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
- (NSUInteger)supportedInterfaceOrientations
#else
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
@interface RNInAppBrowser () <SFSafariViewControllerDelegate, UIAdaptivePresentationControllerDelegate>
#endif
{
return UIInterfaceOrientationMaskAll;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
return orientation;
}

@end
#pragma clang diagnostic pop

NSString *RNInAppBrowserErrorCode = @"RNInAppBrowser";

@implementation RNInAppBrowser

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
static SFAuthenticationSession *sfAuthSession API_AVAILABLE(ios(11.0)) API_DEPRECATED("Use ASWebAuthenticationSession instead", ios(11.0, 12.0));
static SFAuthenticationSession *authSession API_AVAILABLE(ios(11.0)) API_DEPRECATED("Use ASWebAuthenticationSession instead", ios(11.0, 12.0));
#pragma clang diagnostic pop

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
static ASWebAuthenticationSession *authSession API_AVAILABLE(ios(12.0));
static ASWebAuthenticationSession *webAuthSession API_AVAILABLE(ios(12.0));
#pragma clang diagnostic pop

static SFSafariViewController *safariVC;
Expand Down Expand Up @@ -123,27 +88,29 @@ + (BOOL)requiresMainQueueSetup
};

if (@available(iOS 12.0, *)) {
authSession = [[ASWebAuthenticationSession alloc]
webAuthSession = [[ASWebAuthenticationSession alloc]
initWithURL:url
callbackURLScheme:redirectURL
completionHandler:completionHandler];
} else {
sfAuthSession = [[SFAuthenticationSession alloc]
authSession = [[SFAuthenticationSession alloc]
initWithURL:url
callbackURLScheme:redirectURL
completionHandler:completionHandler];
}

#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
if (@available(iOS 13.0, *)) {
authSession.presentationContextProvider = self;
webAuthSession.presentationContextProvider = self;
}
#endif

#pragma clang diagnostic pop
if (@available(iOS 12.0, *)) {
[authSession start];
[webAuthSession start];
} else {
[sfAuthSession start];
[authSession start];
}
} else {
resolve(@{
Expand Down Expand Up @@ -209,19 +176,25 @@ + (BOOL)requiresMainQueueSetup
UIViewController *ctrl = RCTPresentedViewController();
if (modalEnabled) {
// This is a hack to present the SafariViewController modally
UINavigationController *safariHackVC = [[ModalSafariViewController alloc] initWithRootViewController:safariVC];
UINavigationController *safariHackVC = [[UINavigationController alloc] initWithRootViewController:safariVC];
[safariHackVC setNavigationBarHidden:true animated:false];

// To disable "Swipe to dismiss" gesture which sometimes causes a bug where `safariViewControllerDidFinish`
// is not called.
safariVC.modalPresentationStyle = UIModalPresentationOverFullScreen;
safariHackVC.modalPresentationStyle = [self getPresentationStyle: modalPresentationStyle];
if(animated) {
safariHackVC.modalTransitionStyle = [self getTransitionStyle: modalTransitionStyle];
}
safariHackVC.presentationController.delegate = self;
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
if (@available(iOS 13.0, *)) {
[safariHackVC setModalInPresentation:TRUE];
}
#endif
#pragma clang diagnostic pop
[ctrl presentViewController:safariHackVC animated:animated completion:nil];
}
else {
Expand Down Expand Up @@ -268,9 +241,9 @@ - (void)_close
[self flowDidFinish];
}
if (@available(iOS 12.0, *)) {
[authSession cancel];
[webAuthSession cancel];
} else {
[sfAuthSession cancel];
[authSession cancel];
}
} else {
[self close];
Expand Down Expand Up @@ -334,12 +307,15 @@ - (UIModalPresentationStyle)getPresentationStyle:(NSString *)styleKey {
@"overCurrentContext": @(UIModalPresentationOverCurrentContext),
@"popover": @(UIModalPresentationPopover)
};
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
UIModalPresentationStyle modalPresentationStyle = UIModalPresentationFullScreen;
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
if (@available(iOS 13.0, *)) {
modalPresentationStyle = UIModalPresentationAutomatic;
}
#endif
#pragma clang diagnostic pop
NSNumber *style = [styles objectForKey: styleKey];
if (style != nil) {
modalPresentationStyle = [style intValue];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-inappbrowser-reborn",
"version": "3.3.2",
"version": "3.3.4",
"description": "InAppBrowser for React Native",
"main": "index.js",
"files": [
Expand Down
Loading