Phonegap相关
1. 隐藏顶部的状态栏
在xxx-Info.plist中新增一项属性:"Status bar is initially hidden" = YES;此外,还可以增加其他的属性,例如Launch image等。
2. 用户滑动Webview时,正常情况下会超出边界然后弹回来,也就是Bounce,可以通过以下方式禁止这种行为:
在AppDelegate.m中的webViewDidFinishLoad方法中添加:
for (id subview in theWebView.subviews)
if ([[subview class] isSubclassOfClass: [UIScrollView class]])
((UIScrollView *)subview).bounces = NO;
不过在Phonegap1.5版本中已经可以通过Phonegap.plist中的属性来实现了。
3. Phonegap 内购 IAP插件
https://github.com/phonegap/phonegap-plugins/tree/master/iPhone/InAppPurchaseManager
4. 修改Bounce时的背景色
theWebView.backgroundColor = [UIColorgrayColor];
5. Phonegap的deviceready事件通常要比DOMContentLoaded后触发。
Webkit相关
1. 防止页面一定位数的数字自动变成链接
当页面上存在一定位数的数字(例如8位)时,会突然自己变成链接,实际上是被webkit自动解析成电话号码了,可以通过以下方式禁止:
在Classes中的AppDelegate.m中的webViewDidStartLoad中添加
theWebView.dataDetectorTypes = UIDataDetectorTypeNone;
如果是在Safari中则可以通过添加相关的meta标签来设置,而在phonegap中则只能修改OC代码。
2. 阻止a标签长按后打开提示框
长按A标签后,iOS会从底部弹出一个列表,允许你选择以何种方式打开,如果要禁止这种提示时,可以添加下列css属性:
-webkit-touch-callout:none
3. 长按A标签会造成一定区域出现“蒙板式”的阴影,解决方案是添加以下的CSS代码(只在ipad和iphone中有效)
*{-webkit-tap-highlight-color:rgba(0,0,0,0);}
4. 监听视频播放时的全屏事件
// 进入全屏
video.bind( ‘webkitbeginfullscreen’, function() {
alert( ‘begin’ );
} );
// 结束全屏
video.bind( ‘webkitendfullscreen’, function() {
alert( ‘end’ );
} );
5. CPU被独占时,Timer会停止,因此需要考虑应对策略。
其他问题
1. IAP如果遇到问题可以检查以下选项
机器是否越狱,越狱无法测试,query时会返回invalidProductId
Have you enabled In-App Purchases for your App ID?
Have you checked Cleared for Sale for your product?
Does your project’s .plist Bundle ID match your App ID?
Have you configured your project to code sign using this new provisioning profile?Are you using the full product ID when when making an SKProductRequest?Are your bank details active on iTunes Connect?Contracts, Tax, and Banking全部显示Contacts In Effect
Have you tried deleting the app from your device and reinstalling?
2. APN服务器端 pem的生成
Installing the SSL Certificate and Key on the ServerYou should install the SSL distribution certificate and private cryptographic key you obtained earlier on the server computer on which the provider code runs and from which it connects with the sandbox or production versions of APNs. To do so, complete the following steps:
1). Open Keychain Access utility and click the My Certificates category in the left pane.
2). Find the certificate you want to install and disclose its contents.
You’ll see both a certificate and a private key.
3). Select both the certificate and key, choose File > Export Items, and export them as a Personal Information Exchange (.p12) file.
4). Servers implemented in languages such as Ruby and Perl often are better able to deal with certificates in the Personal Information Exchange format. To convert the certificate to this format, complete the following steps:
(1). In KeyChain Access, select the certificate and choose File > Export Items. Select the Personal Information Exchange (.p12) option, select a save location, and click Save.
(2). Launch the Terminal application and enter the following command after the prompt:
openssl pkcs12 -in CertificateName.p12 -out CertificateName.pem -nodes
5). Copy the .pem certificate to the new computer and install it in the appropriate place.
注意:经测试,<iOS5的设备如果连了VPN会收不到PUSH(可以用电脑共享的网络),iOS5是可以的。
3. 手机中打开iTunes链接
itms-apps://+链接
原文链接: http://www.udpwork.com/redirect/6993
分享到:
相关推荐
phongap(cordova 3.x)自己写的一个通讯录 组件demo,里面包含组件和js的调用和plugind的配置以及 读取手机通讯录权限的配置,适合新手学习。犹豫研究市场上好多demo和文档都残缺不全,自己通过一定的努力研究的...
wheresmyrefund 我的退款 Phongap Cordova 应用程序在哪里
cbl-phonegap-chatdemo 一个非常简单的聊天应用程序,它展示了如何通过 PhonGap 使用 CB Lite
安装: sudo npm install -g phonegap bundle install 用于在移动设备上测试应用程序 - phonegap serve 用于观看和实时编译咖啡和火腿使用 guard
一、安装Phongap或Cordova 文档地址 然后使用添加插件命令 cordova plugin add 二、另外的手动步骤 1.请将工程的 Application 类继承 FrontiaApplication 类,在 onCreate 函数中加上:super.onCreate(),否则会崩溃...
empty_jqm_struct 使用 phongap 开始 jquery 移动项目的空代码(使用一些插件,如 sqllite3 和网络...)
利用sencha touch html框架,用phonegap打包apk,android安装包
Cordova6.1、ionic、android交互自定义插件
*Servlet文件夹内是Bingle的源代码,其中BinglePhone为基于iphone4s的phongap web端的源代码 *Xcode文件夹内为iOS端phonegap的本地源代码,直接编译即可用 *功能说明:关键词可以为情感关键词,也可为普通关键词,...
englishextra-app 俄语俄语英语语法-适用于Windows / Android / Linux的应用程序 仪表盘 生产推送网址 遥控器 GitLab 公开下载页面 执照 根据。