Skip to content

Commit 13b0933

Browse files
authored
Merge branch 'master' into master
2 parents c9a4e3e + 6cd521f commit 13b0933

7 files changed

+26
-20
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ in your react-native project, run `npm install react-native-webview-bridge --sav
4545
import com.github.alinz.reactnativewebviewbridge.WebViewBridgePackage;
4646
```
4747

48-
2. add the following code to add the package to `MainApplication.java`` (`MainActivity.java` if RN < 0.29)
48+
2. add the following code to add the package to `MainApplication.java` (`MainActivity.java` if RN < 0.29)
4949

5050
```java
5151
protected List<ReactPackage> getPackages() {
@@ -166,7 +166,7 @@ var Sample2 = createReactClass({
166166
ref="webviewbridge"
167167
onBridgeMessage={this.onBridgeMessage.bind(this)}
168168
injectedJavaScript={injectScript}
169-
source={{uri: "http://google.com"}}/>
169+
source={{uri: "https://google.com"}}/>
170170
);
171171
}
172172
});

ios/RCTWebViewBridge.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,7 @@
1010
* of patent rights can be found in the PATENTS file in the same directory.
1111
*/
1212

13-
#import <UIKit/UIKit.h>
14-
15-
#import <React/RCTAutoInsetsProtocol.h>
16-
#import <React/RCTConvert.h>
17-
#import <React/RCTEventDispatcher.h>
18-
#import <React/RCTLog.h>
19-
#import <React/RCTUtils.h>
2013
#import <React/RCTView.h>
21-
#import <React/UIView+React.h>
22-
23-
#import <objc/runtime.h>
2414

2515
@class RCTWebViewBridge;
2616

ios/RCTWebViewBridge.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@
1212

1313
#import "RCTWebViewBridge.h"
1414

15+
#import <UIKit/UIKit.h>
16+
17+
#import <React/RCTAutoInsetsProtocol.h>
18+
#import <React/RCTConvert.h>
19+
#import <React/RCTEventDispatcher.h>
20+
#import <React/RCTLog.h>
21+
#import <React/RCTUtils.h>
22+
#import <React/RCTView.h>
23+
#import "UIView+React.h"
24+
#import <objc/runtime.h>
25+
1526
//This is a very elegent way of defining multiline string in objective-c.
1627
//source: http://stackoverflow.com/a/23387659/828487
1728
#define NSStringMultiline(...) [[NSString alloc] initWithCString:#__VA_ARGS__ encoding:NSUTF8StringEncoding]
@@ -87,6 +98,7 @@ - (void)sendToBridge:(NSString *)message
8798
}
8899
}());
89100
);
101+
90102
// Escape singlequotes or messages containing ' will fail
91103
NSString *quotedMessage = [message stringByReplacingOccurrencesOfString:@"'" withString:@"\\'"];
92104

ios/RCTWebViewBridgeManager.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#import <React/RCTUIManager.h>
1515
// #import <React/RCTBridge.h> // in forked https://github.com/lefnire/react-native-webview-bridge
1616

17-
#import "RCTWebViewBridge.h"
1817

1918
@interface RCTWebViewBridgeManager : RCTViewManager
2019

ios/RCTWebViewBridgeManager.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212

1313
#import "RCTWebViewBridgeManager.h"
1414

15+
#import <React/RCTBridge.h>
16+
#import <React/RCTUIManager.h>
17+
#import "RCTWebViewBridge.h"
18+
#import "UIView+React.h"
19+
1520
@interface RCTWebViewBridgeManager () <RCTWebViewBridgeDelegate>
1621

1722
@end
@@ -45,7 +50,6 @@ - (UIView *)view
4550
RCT_EXPORT_VIEW_PROPERTY(onShouldStartLoadWithRequest, RCTDirectEventBlock)
4651
RCT_REMAP_VIEW_PROPERTY(allowsInlineMediaPlayback, _webView.allowsInlineMediaPlayback, BOOL)
4752
RCT_EXPORT_VIEW_PROPERTY(onBridgeMessage, RCTDirectEventBlock)
48-
RCT_REMAP_VIEW_PROPERTY(keyboardDisplayRequiresUserAction, _webView.keyboardDisplayRequiresUserAction, BOOL)
4953

5054
- (NSDictionary<NSString *, id> *)constantsToExport
5155
{

webview-bridge/index.android.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
'use strict';
1515

1616
var React = require('react');
17+
React.createClass = require('create-react-class');
18+
var PropTypes = require('prop-types');
1719
var ReactNative = require('react-native');
1820
var createReactClass = require('create-react-class');
1921
var invariant = require('invariant');
@@ -35,7 +37,7 @@ var {
3537
WebViewBridgeManager
3638
}
3739
} = ReactNative;
38-
var PropTypes = require('prop-types');
40+
var { PropTypes } = PropTypes;
3941

4042
var RCT_WEBVIEWBRIDGE_REF = 'webviewbridge';
4143

webview-bridge/index.ios.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
*/
1515
'use strict';
1616

17-
// HACKFIX: https://github.com/facebook/metro-bundler/issues/74 - error: bundling failed: UnableToResolveError: Unable to resolve module `react` from `/Users/garyfung/Dropbox/Code/react-native-webview-bridge-RN0.40/webview-bridge/index.ios.js`: Module does not exist in the module map
18-
// do same in node_modules/create-react-class/index.js on npm/yarn upgrade
19-
// NOTE: metro bundler can't find react because node_modules symlink to this local package on ~/Dropbox?
20-
var React = require('/Users/garyfung/Documents/code/WonderSwipe/node_modules/react');
17+
var React = require('react');
18+
React.createClass = require('create-react-class');
19+
var PropTypes = require('prop-types');
2120
var ReactNative = require('react-native');
2221
var createReactClass = require('create-react-class');
2322
var invariant = require('invariant');
@@ -38,7 +37,7 @@ var {
3837
WebViewBridgeManager,
3938
},
4039
} = ReactNative;
41-
var PropTypes = require('prop-types');
40+
var { PropTypes } = PropTypes;
4241

4342
var BGWASH = 'rgba(255,255,255,0.8)';
4443
var RCT_WEBVIEWBRIDGE_REF = 'webviewbridge';

0 commit comments

Comments
 (0)