您好,我使用WebView集成方式进行集成,通过加载http协议进行加载我们服务器的h5页面,但是就只加载了首页,首页上的其他页面链接就加载不出来哦,h5开发人员一直认为是sdk集成有问题,我重复审核了几次文档,没找出问题,我比较着急,就打搅你一下了,我的问题如下:1、PDRCoreAppFrame里的frameName是随便定义的吗?2、设置默认启动应用的APPID,这个appid我从哪里取,是随便定义的吗?
参考的文档流程:
使用Webview方式进行集成HTML5+SDK,开发者可以在任意位置显示支持HTML5+扩展API的WebView页面,具体步骤如下
1.获取PDRCore句柄
2.设置HTML5+ SDK运行方式
3.设置默认启动应用的APPID
4.创建PDRCoreAppFrame,并指定Webview的ID和URL,并指定打开的WebView的Frame。
5.设置PDRCoreFrame的WebView的Request,Webview会显示Request返回的页面
6.将PDRCoreFrame句柄设置为指定View的WebView;
我的集成代码如下:
1、在AppDelegate里主要代码:
-
(BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions
{
UINavigationController* pNavCon = [[UINavigationController alloc]
initWithRootViewController:_window.rootViewController];
_window.rootViewController = pNavCon;self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = kWhiteColor;[self applicationConfiguration];
[self layoutMainView];// 设置当前SDK运行模式
return [PDRCore initEngineWihtOptions:launchOptions withRunMode:PDRCoreRunModeWebviewClient];
}
2、在自定义的Controller里配置Webview方式加载:
-
(void)html5
{
PDRCore pCoreHandle = [PDRCore Instance];
if (pCoreHandle != nil)
{
[pCoreHandle start];
//http协议路径
NSString pFilePath = [[NSUserDefaults standardUserDefaults] stringForKey:kEnterUrl];
if ([[PDRCore Instance] respondsToSelector:@selector(startAsWebClient)]) {
[[PDRCore Instance] performSelector:@selector(startAsWebClient)];
}
if(appFrame){
[appFrame removeFromSuperview];
}
CGRect StRect = CGRectMake(0, 0, _contentView.width, _contentView.height);
appFrame = [[PDRCoreAppFrame alloc] initWithName:@"WebViewID1" loadURL:pFilePath frame:StRect];
if (appFrame) {
[pCoreHandle.appManager.activeApp.appWindow registerFrame:appFrame];
[_contentView addSubview:appFrame];
}}
}
r***@ishinetech.com (作者)
目前我们开发的的html5要使用5+ sdk的api,但是html5是部署在服务器,客户端远程访问,那此种情况需要appid吗,因为h5开发人员不一定使用hbuider进行开发html5代码,
2016-12-21 13:17
r***@ishinetech.com (作者)
此外,为了研究,我们把html5+的演示demo的html等资源文件部署到了我们服务器,首页能加载出来,但是就是跳转不了,会是什么原因呢,
2016-12-21 13:24