把项目放在本地IOS是好用的,widget方式,现在把项目放在远程服务器上,就不能跳页了,是我没有配置好,还是不支持远程访问。
-(IBAction)ShowWebViewPageTwo:(id)sender
{
//
[self.view addSubview:_containerView];
// 设置WebApp所在的目录,该目录下必须有mainfest.json
NSString* pWWWPath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"Pandora/apps/HelloH5/www"];
NSString* pWWWPath2 = @"http://123.57.175.233:8088/ApiCloudDemo/www";
// 如果路径中包含中文,或Xcode工程的targets名为中文则需要对路径进行编码
//NSString* pWWWPath2 = (NSString *)CFURLCreateStringByAddingPercentEscapes( kCFAllocatorDefault, (CFStringRef)pTempString, NULL, NULL, kCFStringEncodingUTF8 );
// 设置5+SDK运行的View
[[PDRCore Instance] setContainerView:_containerView];
// 传入参数可以在页面中通过plus.runtime.arguments参数获取
NSString* pArgus = @"id=plus.runtime.arguments";
// 启动该应用
pAppHandle = [[[PDRCore Instance] appManager] openAppAtLocation:pWWWPath withIndexPath:@"modul/main/login.html" withArgs:pArgus withDelegate:nil];
// 如果应用可能会重复打开的话建议使用restart方法
//[[[PDRCore Instance] appManager] restart:pAppHandle];
}
这是点击方法:pWWWPath本地好用,pWWWPath2服务器就跳不了页,请高手解答。
2 个回复
fsyang - 插件开发,离线打包技术咨询等,qq 37894663
同样遇到这个问题,感觉是ios安全机制的问题,跳页也加上ip貌似可以应付下
骁骑
使用WebView方式进行集成,在页面里不支持使用plus.webview.createWebView 的方法创建新的窗口的,你可以使用WebApp的方式集成,WebApp方式也支持使用网络路径