2017-04-24 08:01:20 +00:00
|
|
|
#import "React/RCTView.h"
|
2015-12-08 17:06:22 +00:00
|
|
|
|
2016-12-20 09:55:09 +00:00
|
|
|
@class RCTWKWebView;
|
2015-12-08 17:06:22 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Special scheme used to pass messages to the injectedJavaScript
|
|
|
|
* code without triggering a page load. Usage:
|
|
|
|
*
|
|
|
|
* window.location.href = RCTJSNavigationScheme + '://hello'
|
|
|
|
*/
|
|
|
|
extern NSString *const RCTJSNavigationScheme;
|
|
|
|
|
2016-12-20 09:55:09 +00:00
|
|
|
@protocol RCTWKWebViewDelegate <NSObject>
|
2015-12-08 17:06:22 +00:00
|
|
|
|
2016-12-20 09:55:09 +00:00
|
|
|
- (BOOL)webView:(RCTWKWebView *)webView
|
2015-12-08 17:06:22 +00:00
|
|
|
shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
|
|
|
|
withCallback:(RCTDirectEventBlock)callback;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2016-12-20 09:55:09 +00:00
|
|
|
@interface RCTWKWebView : RCTView
|
2015-12-08 17:06:22 +00:00
|
|
|
|
2016-12-20 09:55:09 +00:00
|
|
|
@property (nonatomic, weak) id<RCTWKWebViewDelegate> delegate;
|
2015-12-08 17:06:22 +00:00
|
|
|
|
2016-02-24 16:55:32 +00:00
|
|
|
@property (nonatomic, copy) NSDictionary *source;
|
2015-12-08 17:06:22 +00:00
|
|
|
@property (nonatomic, assign) UIEdgeInsets contentInset;
|
|
|
|
@property (nonatomic, assign) BOOL automaticallyAdjustContentInsets;
|
2016-12-20 09:55:09 +00:00
|
|
|
@property (nonatomic, assign) BOOL sendCookies;
|
2015-12-08 17:06:22 +00:00
|
|
|
@property (nonatomic, copy) NSString *injectedJavaScript;
|
2016-12-16 09:29:54 +00:00
|
|
|
@property (nonatomic, copy) NSString *injectedOnStartLoadingJavaScript;
|
2015-12-08 17:06:22 +00:00
|
|
|
|
|
|
|
- (void)goForward;
|
|
|
|
- (void)goBack;
|
|
|
|
- (void)reload;
|
2016-12-20 09:55:09 +00:00
|
|
|
- (void)evaluateJavaScript:(NSString *)javaScriptString completionHandler:(void (^)(id, NSError *error))completionHandler;
|
2015-12-08 22:16:58 +00:00
|
|
|
- (void)sendToBridge:(NSString *)message;
|
2015-12-08 17:06:22 +00:00
|
|
|
|
|
|
|
@end
|