#import "SHRMWebViewEngine.h"
@interface TestUIWebViewController ()
@property (nonatomic, strong) SHRMWebViewEngine* bridge;
@end
/*
webView:UIWebView or WKWebView instance
*/
_bridge = [SHRMWebViewEngine bindBridgeWithWebView:webView];
[_bridge setWebViewDelegate:self];
#import "SHRMBasePlugin.h"
@interface SHRMTestUIWebViewPlguin : SHRMBasePlugin
- (void)nativeTestUIWebView:(SHRMMsgCommand *)command;
@end
@SHRMRegisterWebPlugin(SHRMTestUIWebViewPlguin, 1)
@implementation SHRMTestUIWebViewPlguin
- (void)nativeTestUIWebView:(SHRMMsgCommand *)command {
NSString *method = [command argumentAtIndex:0];
NSString *url = [command argumentAtIndex:1];
NSString *param = [command argumentAtIndex:2];
NSLog(@"(%@):%@,%@,%@",command.callbackId, method, url, param);
SHRMPluginResult *result = [SHRMPluginResult resultWithStatus:SHRMCommandStatus_OK messageAsString:@"uiwebview test success!"];
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
}
@end