We'll discuss this with H5. Pass a struct parameter past, and then because of the parsing problem, which leads me to pass the arguments here, to H5 there is no way to execute that side
-(void) Logincallback
{
Nsdictionary *dic;
user = [Ibkeychain Loadvalueforkey:kuserkey];
if (user) {
Dic= @{
@ "id": [User objectforkey:@ "UserId"],
@ "token": [User objectforkey:@ "Access_token"],
@ "Apptag": @ "IOS"
};
}else{
Dic= @{
@ "id": @ "",
@ "token": @ "",
@ "Apptag": @ "IOS"
};
}
NSData *jsondata = [nsjsonserialization
Datawithjsonobject:dic options:0
Error:nil];
NSString *result = [[NSString alloc] Initwithdata:jsondata encoding:nsutf8stringencoding];
NSString *jsstr = [NSString stringwithformat:@ "Applogincallback ('%@ ');", result];
[Self.webview STRINGBYEVALUATINGJAVASCRIPTFROMSTRING:JSSTR];
Return
}
And then you can call the method.
-(void) Webviewdidfinishload: (UIWebView *) WebView
{
[Self hideloadingview];
[Self logincallback];
}
Ios-oc Invoke JS page