phonegap

Which event to listen to during inertia/momentum scroll on Cordova iOS w/ React

守給你的承諾、 提交于 2019-12-10 10:04:19
问题 I have a React app running on iOS through cordova/phonegap. In one component, I have a toolbar that sticks to the top of the screen once you scroll past it: <div id="content">Some stuff in here</div> <div id="tool-bar"> <div class="tool">Tool 1</div> <div class="tool">Tool 2</div> </div> <div id="some-stuff-below-toolbar">Stuff</div> You get the picture. Whenever the user scrolls, the Y position is calculated, and if it's below the offset, the tool bar gets a class 'sticky' and CSS to fix it

How to add function on button in phonegap?

孤街浪徒 提交于 2019-12-10 03:26:47
问题 I'm new to Phonegap and I want to develop a Phonegap application for Android.. I want to give some function on button click on my html.. I've tried this code but it does not work: index.html <!DOCTYPE HTML> <html> <head> <title>PhoneGap</title> <script type="text/javascript" charset="utf-8" src="phonegap.js"></script> <script type="text/javascript" charset="utf-8" src="mycode.js"></script> </head> <body onload="init();> <h1>Hello World</h1> <form> <input type="button" value="Click me" onclick

如何在Android中使用AdMob和phonegap

半腔热情 提交于 2019-12-09 17:11:28
安装AdMob PhoneGap插件 使用https://github.com/admob-google/admob-cordova下载插件,然后本地安装 添加cordova plugin c:\phonegap-admob-plugin,或者在线安装cordova 插件。 cordova plugin add com.admob.plugin 使用PhoneGap命令下载插件,然后本地安装 添加 phonegap plugin c:\phonegap-admob-plugin。 使用PhoneGap的生成,增加配置 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> 2.init AdMob PhoneGap插件 初始化插件后deviceready事件 admob.initAdmob("admob banner ID","admob interstitial ID"); 3.展示横幅的位置关系 AdMob里有一些横幅大小,BannerSize,你可以创建自己的横幅大小在AdMob广告平台可用,位置容纳所有的相对位置常量。 <uses-feature android:name="android.hardware.microphone" android:required="false"

集成AdMob到Phonegap应用程序

依然范特西╮ 提交于 2019-12-09 16:49:31
有多种方式来赚钱的应用程序。当我们决定要使用哪一个时,我们必须承认一些因素:谁是我们的客户,我们有什么样的应用程序,我们想赚多少钱等等。有了这些因素,我们生成一个清单。对于大多数应用程序,清单显示我们应该在应用程序内部使用某种类型的广告。为此,最好的解决方案之一是AdMob。 AdMob公司在平台上汇聚了一流的技术,所以你可以得到你的用户的见解,推动更多的应用内购买,并最大限度地提高你的广告收入。你不再需要依赖于工具的组合或使用宝贵的开发资源来建立你的解决方案。 集成AdMob到你的PhoneGap应用,你需要一个cordova-admob插件。AdMob有许多的PhoneGap插件,但这是一个最好的支持和精心设计。它支持所有的主要的和重要的广告设备。 1.Android 2.ios 3.Windows Phone 它有一些非常好的功能: • 使用方便:使用javascript代码行显示广告。 • 强大:支持横幅、插播和视频广告。 • 高收入:支持调解与多达8个领先的移动广告服务。 • 多尺寸:多种横幅的大小,也支持自定义尺寸。 • 灵活:固定和重叠的模式,把旗帜与叠加模式的任何位置。 • 智能:对方向变化自动调整。 • 相同的API:与其他广告插件完全一样的API,轻松切换从一个广告服务到另一个。 • 更新:最新的SDK和Android谷歌播放服务。 • 最好的支持:保持积极

如何使用PhoneGap的构建

梦想的初衷 提交于 2019-12-09 15:04:38
在config.xml中插件可以用来通过配置插件(为每个应用程序构建phonegap构建服务,你需要有一个config.xml文件在你的根文件夹)。 据Cordova队公布,Cordova注册表已过时,所有的插件都搬到了npm, 并更名为"cordova-plugin-xxx"。 在你的config.xml文件: <uses-permission android:name="android.permission.RECORD_AUDIO" />或 <uses-feature android:name="android.hardware.microphone" android:required="false" /> 使用那个插件标识? 请注意,有两个插件之间的一些细微的差别: • cordova-plugin-admobpro, 在你的Android SDK中它使用默认的jar,需要构建Gradle的Android apk。看到它的plugin.xml: <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> • cordova-plugin-admob,它依赖于一个插件包含了google-play-services.jar,可以使用这些工具代替Gradle。看到它的plugin.xml:

Adobe Phonegap Push Notifications with Firebase Cloud on Android

寵の児 提交于 2019-12-08 14:38:05
问题 Since 2018 the standard Phonegap push notifiction sample project no longer works. I am struggling to find a functional way to send a push notification to an app. So far I have done the following: Set up the Adobe Phonegap push notification sample project Set up a Firebase Cloud account and created a project and added an Android app to it. Downloaded the google-services.json Installed phonegap-plugin-push (1.8.0 as apparently anything over 2.0 has problems), and included my Sender ID Installed

Why does cordova-plugin-nativestorage work on browser but not on phone

£可爱£侵袭症+ 提交于 2019-12-08 13:30:50
I am using the Phonegap CLI to serve my project and my plugin version is: 2.3.1 So, I wrote the following code to execute after the device is ready: NativeStorage.getItem("abcd",function(){ console.log("success");alert("success"); },function(){ console.log("fail");alert("failed :)"); }); This works perfectly when I am testing it on my browser. However, when I open this app on my android phone, the NativeStorage code does not work at all. I used weinre to debug my app: I got the error: ReferenceError: NativeStorage is not defined I also removed the plugin and all the platforms and reinstalled

Not able to emulate ios with Cordova

耗尽温柔 提交于 2019-12-08 11:56:00
问题 I'm going through the beginner series for a Cordova application. I installed XCode and created a new Cordova project. That being said, when I run cordova emulate ios , I get the following error: No target specified for emulator. Deploying to iPhone-X, 12.1 simulator /Users/osx/Code/cordova-poc/platforms/ios/build/emulator/HelloCordova.app/Info.plist file not found. If I run cordova build ios and run the code in XCode, then I can see that Xcode opens up the emulator where I can see my changes.

Accessing a remote API that requires a whitelisted referring domain name via Cordova

随声附和 提交于 2019-12-08 09:21:11
问题 I have a general use question before I go down a road that might not be possible. I want to build an app that can interface with an API (read data and update date) on an external website. The external site offers two methods to connect to the API, a client and server set of API calls. The client method requires whitelisting the referring domain and the server method requires whitelisting the IP of the referring site. If I'm building a regular webpage and want to connect to the API then if

Why does cordova-plugin-nativestorage work on browser but not on phone

笑着哭i 提交于 2019-12-08 07:14:54
问题 I am using the Phonegap CLI to serve my project and my plugin version is: 2.3.1 So, I wrote the following code to execute after the device is ready: NativeStorage.getItem("abcd",function(){ console.log("success");alert("success"); },function(){ console.log("fail");alert("failed :)"); }); This works perfectly when I am testing it on my browser. However, when I open this app on my android phone, the NativeStorage code does not work at all. I used weinre to debug my app: I got the error: