Authored by gaoqiang xu

优化消息机能

... ... @@ -72,6 +72,8 @@
native = [[abilityClass alloc] init];
weakSelf.abilities[NSStringFromClass(abilityClass)] = native;
}
native.originalParams = info;
BOOL canProcess = YES;
if (weakIf && [weakIf respondsToSelector:@selector(nativeActionShouldBegin:)]) {
... ...
... ... @@ -38,11 +38,11 @@ NSString * const YHNative_Messenger = @"YHNativeMessage";
- (void)forwardInvocation:(NSInvocation *)anInvocation
{
NSString *selector = NSStringFromSelector(anInvocation.selector);
NSDictionary *message = @{ @"event": selector };
[self handleMessage:message];
if ([YHNative instancesRespondToSelector:anInvocation.selector]) {
[super forwardInvocation:anInvocation];
} else {
[self handleMessage:self.originalParams];
}
}
... ...
... ... @@ -40,6 +40,7 @@ typedef void(^onFailure)(NSString *message);
*/
@interface YHNative : NSObject
@property (copy, nonatomic) NSDictionary *originalParams;
@property (strong, nonatomic) NSDictionary *options;
@property (copy, nonatomic) onSuccess successCallBack;
@property (copy, nonatomic) onFailure failureCallBack;
... ...
... ... @@ -27,5 +27,21 @@
</Actions>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../YHExplorer/CordovaPlugins/CDVYHInterface.m"
timestampString = "471763039.615788"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "65"
endingLineNumber = "65"
landmarkName = "-eventTriggered:"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
... ...
... ... @@ -73,7 +73,7 @@
} else if ([title isEqualToString:@"链接跳转"]) {
wv.url = @"http://sealedace.com/content/images/test/h5_test.html";
} else {
wv.url = @"http://yohomars.test.yoho.cn/message/index?uid=8654049&session_code=00840ce1bccbf76c3b9b6ab34e0c5f50";
wv.url = @"http://yohomars.test.yoho.cn/message/index?uid=8654049&session_code=00840ce10f61844257920a986ed1b647";
}
[self.navigationController pushViewController:wv animated:YES];
... ...