Skip to content

Latest commit

 

History

History
135 lines (117 loc) · 4.59 KB

README.md

File metadata and controls

135 lines (117 loc) · 4.59 KB

使用的是cordova4.0.1

实现步奏

  1. 创建项目工程 使用pod platform :ios, '8.0' pod 'Cordova', '~> 4.0.1'

  2. 配置confing.xml 非常重要

Hello Cordova A sample Apache Cordova application that responds to the deviceready event. Apache Cordova Team

CPlugin Cordova CPlugin Plugin Apache 2.0 cordova,device

3.如需使用自定义插件与h5进行交互 需要在 CDVViewController 的init 方法里面加入一些代码

  • (instancetype)init { self = [super init]; if (self != nil) { //设置用户代理如不设置无法调用与H5定制的JavaScript方法进行交互 NSString* original = [CDVUserAgentUtil originalUserAgent]; NSString* userAgent = [original stringByAppendingString:@"WeiLian_IOS"]; self.baseUserAgent = userAgent; } return self; } 然后就可以了