使用Cordova 5.1.1时,执行"cordova build ios"时,先前在XCode项目中选择的任何设备方向设置都将被删除,而未选中方向设置复选框.
虽然"方向"配置首选项可能提供强制定位的方法,但我需要能够为iPad和iPhone设置不同的方向首选项.
所有以前的Cordova版本(低于5)都尊重这些设置.有任何想法吗?
使用XCode 6.3.2.
我想用Cordova构建一个自定义WebView.为此,我想覆盖setWebChromeClient和setWebViewClient方法.但是为此我需要一个SystemWebViewClient,它需要一个SystemWebViewEngine,我现在似乎无法得到它.这是我的主要活动
public class MyActivity extends CordovaActivity implements CordovaInterface {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int threadSize = getResources().getInteger(R.integer.WIPThreadPoolSize);
// Initiate Thread pool
threadPool = new ThreadPoolExecutor(threadSize, threadSize, 10, TimeUnit.SECONDS, this.priorityQueue);
initApplicationInformationManager();
// initialize global variables
GlobalApplicationVariables.initValues(this);
isActivityReady = false;
isActivityReady = false;
setContentView(R.layout.main_layout);
super.init();
}
protected CordovaWebView makeWebView() {
SystemWebView webView = (SystemWebView) findViewById(R.id.customWebView);
SystemWebViewEngine engine = new SystemWebViewEngine(webView);
return new CordovaWebViewImpl(engine);
}
protected void createViews() {
appView.getView().requestFocusFromTouch();
}
}
Run Code Online (Sandbox Code Playgroud)
我的自定义webview:
@SuppressLint("SetJavaScriptEnabled")
public class CustomWebView extends SystemWebView {
private …Run Code Online (Sandbox Code Playgroud) 我在cordova 5.x上工作,我会生成一个签名apk.
我开始使用带有证书凭据的cordova项目根目录下的build.json:
{
"android": {
"debug": {
"keystore": "cert.keystore",
"storePassword": "*****",
"alias": "1",
"password" : "*****",
"keystoreType": "PKCS12"
},
Run Code Online (Sandbox Code Playgroud)
它在平台/ android中创建了一个release-signing.properties:
key.store=..\\..\\cert.keystore
key.alias=1
key.store.password=*****
key.alias.password=*****
key.store.type=PKCS12
Run Code Online (Sandbox Code Playgroud)
但是我有一个错误:cert.keystore":DerInputStream.getLength():lengthTag = 109,太大了(因为它不懂键是PKCS12类型)
在我写完自己的release-signing.properties之后:
storeFile=..\\..\\cert.keystore
storePassword=*****
keystoreType=PKCS12
keyAlias=1
keyPassword=*****
Run Code Online (Sandbox Code Playgroud)
它有效...所以我不明白为什么第一个解决方案不起作用.
我正在开发Cordova Android移动应用程序.使用Sencha touch作为UI框架.在应用程序中我正在进行Web服务调用.它曾经与旧版Cordova一起工作,最近将Cordova proj升级到5.0.0,从此无法访问更新版Android设备上的任何Web服务.我在项目中包含了白名单插件.还在index.html中包含了以下元标记
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">
Run Code Online (Sandbox Code Playgroud)
config.xml:
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
Run Code Online (Sandbox Code Playgroud)
运行应用程序时会引发以下错误,
"Refused to connect to 'http://my-server-url.ss.yy.com:8080/SomeServ/rest/someapp/appdata?_dc=1433398248330' because it violates the following Content Security Policy directive: "default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-inline' 'unsafe-eval'". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.
Run Code Online (Sandbox Code Playgroud)
我无法从这里前进.在谷歌上尝试了很多建议,但没有用.请指导我这里缺少什么. …
android sencha-touch content-security-policy cordova-plugins cordova-5.0.0