search

Home  >  Q&A  >  body text

javascript - ios native page interacts with h5 page

1. Use uiwebview to load the remote h5 page, and then click on some functions involving transactions to call the native login page to log in. After successful login, enter the h5 page corresponding to the click function
2. Use the h5 page to call the native method Implement
jsContext[@"nativePage"] = ^(){

NSArray *args = [JSContext currentArguments];
NSDictionary *argDic = nil;
 if(args.count >=1){
     JSValue *value = [args objectAtIndex:0];
     argDic = value.toObject;
 }
 if(argDic!=nil){
       NSString *type =[argDic objectForKey:@"type"];
       NSString *title =[argDic objectForKey:@"title"];
 }
 然后根据获取的值进行页面跳转,遇到需要登录之后才能操作的时候怎么进行判断,点击某一个功能,根据获取参数跳转到登录页面进行登录,登录成功之后,跳转到点击功能二级页面
 返回type为1时跳转原生页面,为2时跳转h5页面,一次只获取一个type登录成功之后怎么传递二级页面的参数
 
    
PHP中文网PHP中文网2802 days ago790

reply all(0)I'll reply

No reply
  • Cancelreply