Skip to content

Commit cfbde73

Browse files
authored
Merge pull request proyecto26#138 from proyecto26/master
Release v3.3.4
2 parents 5896a20 + 7c663b8 commit cfbde73

File tree

8 files changed

+783
-899
lines changed

8 files changed

+783
-899
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ in case of vulnerabilities.
2222

2323
## [Unreleased]
2424

25+
## [3.3.4] - 2020-01-07
26+
27+
### Fixed
28+
- Disable swipe to dismiss gesture for modal by [@frankyjuang](https://github.com/frankyjuang) ([#134](https://github.com/proyecto26/react-native-inappbrowser/pull/134)).
29+
30+
## [3.3.3] - 2019-11-25
31+
32+
### Fixed
33+
- Remove build warnings with **iOS** 13 using [Pragmas](https://clang.llvm.org/docs/UsersManual.html#controlling-diagnostics-via-pragmas).
34+
2535
## [3.3.2] - 2019-11-15
2636

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

137147

138-
[Unreleased]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.3.2...HEAD
148+
[Unreleased]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.3.4...HEAD
149+
[3.3.4]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.3.3...v3.3.4
150+
[3.3.3]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.3.2...v3.3.3
139151
[3.3.2]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.3.1...v3.3.2
140152
[3.3.1]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.3.0...v3.3.1
141153
[3.3.0]: https://github.com/proyecto26/react-native-inappbrowser/compare/v3.2.0...v3.3.0

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ import InAppBrowser from 'react-native-inappbrowser-reborn'
210210

211211
### Authentication Flow using Deep Linking
212212

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

215216
- Enable deep linking (Android) - **[AndroidManifest.xml](https://github.com/proyecto26/react-native-inappbrowser/blob/master/example/android/app/src/main/AndroidManifest.xml#L23)**
216217
```

example/ios/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ PODS:
8181
- React-RCTWebSocket (0.60.0):
8282
- React-Core (= 0.60.0)
8383
- React-fishhook (= 0.60.0)
84-
- RNInAppBrowser (3.0.0):
84+
- RNInAppBrowser (3.3.3):
8585
- React
8686
- yoga (0.60.0.React)
8787

@@ -111,7 +111,7 @@ DEPENDENCIES:
111111
- yoga (from `../node_modules/react-native/ReactCommon/yoga`)
112112

113113
SPEC REPOS:
114-
https://github.com/cocoapods/specs.git:
114+
https://github.com/CocoaPods/Specs.git:
115115
- boost-for-react-native
116116

117117
EXTERNAL SOURCES:
@@ -185,9 +185,9 @@ SPEC CHECKSUMS:
185185
React-RCTText: 685fca2e13b024271048e7e247ef24476f28a41e
186186
React-RCTVibration: 4ee1cf208ab17a50fafb1c16ffe28fe594a64e4f
187187
React-RCTWebSocket: fca087d583724aa0e5fef7d911f0f2a28d0f2736
188-
RNInAppBrowser: 5bf209eafe43a1de18b81125ed1f9f5702b2ec1a
188+
RNInAppBrowser: 0800f17fd7ed9fc503eb68e427befebb41ee719b
189189
yoga: 616fde658be980aa60a2158835170f3f9c2d04b4
190190

191191
PODFILE CHECKSUM: e6321daab2a139195c1bcaad4b674c568140b44a
192192

193-
COCOAPODS: 1.7.3
193+
COCOAPODS: 1.8.0

example/ios/example.xcodeproj/project.pbxproj

Lines changed: 52 additions & 52 deletions
Large diffs are not rendered by default.

ios/RNInAppBrowser.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,4 @@
55
#endif
66

77
@interface RNInAppBrowser : NSObject <RCTBridgeModule>
8-
@end
9-
10-
@interface ModalSafariViewController : UINavigationController <UINavigationControllerDelegate>
11-
@end
8+
@end

ios/RNInAppBrowser.m

Lines changed: 30 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -15,63 +15,28 @@
1515
#import <AuthenticationServices/AuthenticationServices.h>
1616
#endif
1717

18-
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_13_0
19-
@interface RNInAppBrowser () <SFSafariViewControllerDelegate, UIAdaptivePresentationControllerDelegate>
20-
@end
21-
#else
18+
#pragma clang diagnostic push
19+
#pragma clang diagnostic ignored "-Wpartial-availability"
20+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
2221
@interface RNInAppBrowser () <SFSafariViewControllerDelegate, ASWebAuthenticationPresentationContextProviding, UIAdaptivePresentationControllerDelegate>
23-
@end
24-
#endif
25-
26-
@interface ModalSafariViewController () <UINavigationControllerDelegate>
27-
@end
28-
29-
@implementation ModalSafariViewController
30-
31-
- (void)viewDidLoad {
32-
[super viewDidLoad];
33-
}
34-
35-
- (void)viewWillAppear:(BOOL)animated {
36-
[super viewWillAppear:animated];
37-
}
38-
39-
- (void)viewDidDisappear:(BOOL)animated {
40-
[super viewDidDisappear:animated];
41-
}
42-
43-
- (BOOL)shouldAutorotate {
44-
return YES;
45-
}
46-
47-
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
48-
- (NSUInteger)supportedInterfaceOrientations
4922
#else
50-
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
23+
@interface RNInAppBrowser () <SFSafariViewControllerDelegate, UIAdaptivePresentationControllerDelegate>
5124
#endif
52-
{
53-
return UIInterfaceOrientationMaskAll;
54-
}
55-
56-
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
57-
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
58-
return orientation;
59-
}
60-
6125
@end
26+
#pragma clang diagnostic pop
6227

6328
NSString *RNInAppBrowserErrorCode = @"RNInAppBrowser";
6429

6530
@implementation RNInAppBrowser
6631

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

7237
#pragma clang diagnostic push
7338
#pragma clang diagnostic ignored "-Wpartial-availability"
74-
static ASWebAuthenticationSession *authSession API_AVAILABLE(ios(12.0));
39+
static ASWebAuthenticationSession *webAuthSession API_AVAILABLE(ios(12.0));
7540
#pragma clang diagnostic pop
7641

7742
static SFSafariViewController *safariVC;
@@ -123,27 +88,29 @@ + (BOOL)requiresMainQueueSetup
12388
};
12489

12590
if (@available(iOS 12.0, *)) {
126-
authSession = [[ASWebAuthenticationSession alloc]
91+
webAuthSession = [[ASWebAuthenticationSession alloc]
12792
initWithURL:url
12893
callbackURLScheme:redirectURL
12994
completionHandler:completionHandler];
13095
} else {
131-
sfAuthSession = [[SFAuthenticationSession alloc]
96+
authSession = [[SFAuthenticationSession alloc]
13297
initWithURL:url
13398
callbackURLScheme:redirectURL
13499
completionHandler:completionHandler];
135100
}
136101

137-
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
102+
#pragma clang diagnostic push
103+
#pragma clang diagnostic ignored "-Wpartial-availability"
104+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
138105
if (@available(iOS 13.0, *)) {
139-
authSession.presentationContextProvider = self;
106+
webAuthSession.presentationContextProvider = self;
140107
}
141108
#endif
142-
109+
#pragma clang diagnostic pop
143110
if (@available(iOS 12.0, *)) {
144-
[authSession start];
111+
[webAuthSession start];
145112
} else {
146-
[sfAuthSession start];
113+
[authSession start];
147114
}
148115
} else {
149116
resolve(@{
@@ -209,19 +176,25 @@ + (BOOL)requiresMainQueueSetup
209176
UIViewController *ctrl = RCTPresentedViewController();
210177
if (modalEnabled) {
211178
// This is a hack to present the SafariViewController modally
212-
UINavigationController *safariHackVC = [[ModalSafariViewController alloc] initWithRootViewController:safariVC];
179+
UINavigationController *safariHackVC = [[UINavigationController alloc] initWithRootViewController:safariVC];
213180
[safariHackVC setNavigationBarHidden:true animated:false];
214181

182+
// To disable "Swipe to dismiss" gesture which sometimes causes a bug where `safariViewControllerDidFinish`
183+
// is not called.
184+
safariVC.modalPresentationStyle = UIModalPresentationOverFullScreen;
215185
safariHackVC.modalPresentationStyle = [self getPresentationStyle: modalPresentationStyle];
216186
if(animated) {
217187
safariHackVC.modalTransitionStyle = [self getTransitionStyle: modalTransitionStyle];
218188
}
219189
safariHackVC.presentationController.delegate = self;
220-
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
190+
#pragma clang diagnostic push
191+
#pragma clang diagnostic ignored "-Wpartial-availability"
192+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
221193
if (@available(iOS 13.0, *)) {
222194
[safariHackVC setModalInPresentation:TRUE];
223195
}
224196
#endif
197+
#pragma clang diagnostic pop
225198
[ctrl presentViewController:safariHackVC animated:animated completion:nil];
226199
}
227200
else {
@@ -268,9 +241,9 @@ - (void)_close
268241
[self flowDidFinish];
269242
}
270243
if (@available(iOS 12.0, *)) {
271-
[authSession cancel];
244+
[webAuthSession cancel];
272245
} else {
273-
[sfAuthSession cancel];
246+
[authSession cancel];
274247
}
275248
} else {
276249
[self close];
@@ -334,12 +307,15 @@ - (UIModalPresentationStyle)getPresentationStyle:(NSString *)styleKey {
334307
@"overCurrentContext": @(UIModalPresentationOverCurrentContext),
335308
@"popover": @(UIModalPresentationPopover)
336309
};
310+
#pragma clang diagnostic push
311+
#pragma clang diagnostic ignored "-Wpartial-availability"
337312
UIModalPresentationStyle modalPresentationStyle = UIModalPresentationFullScreen;
338-
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
313+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
339314
if (@available(iOS 13.0, *)) {
340315
modalPresentationStyle = UIModalPresentationAutomatic;
341316
}
342317
#endif
318+
#pragma clang diagnostic pop
343319
NSNumber *style = [styles objectForKey: styleKey];
344320
if (style != nil) {
345321
modalPresentationStyle = [style intValue];

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-inappbrowser-reborn",
3-
"version": "3.3.2",
3+
"version": "3.3.4",
44
"description": "InAppBrowser for React Native",
55
"main": "index.js",
66
"files": [

0 commit comments

Comments
 (0)