phonegap-plugins

navigator.onLine not working cordova 5.0.0

醉酒当歌 提交于 2019-12-01 10:57:15
I am having problems with checking if a device has no internet connection. I am using cordova 5.0.0 CLI. This is my code: if(navigator.onLine) { alert("online"); } else { alert("offline"); window.open("404.html"); } The problem is: it's always true. How can i fix it? I know this plugin , but I don't know how I even get it working. I know how to add plugins, but then it ends. Could someone help me getting this plugin working, or an alternative code to check if a user is offline? Thanks in advance Add this to your index.html : document.addEventListener("offline", function(){ navigator

phonegap background service in iOS5

对着背影说爱祢 提交于 2019-12-01 10:40:59
I am writing update checker program in xcode, my program needs background process( it needs to be run in background), so is it possible in phonegap, and is there any phonegap plugin for background services? Thanks dhaval iOS does not allow background task to run more than a specific time limit. Similar Post: iPhone background task stops running at some point Explanation: http://www.macworld.com/article/1164616/how_ios_multitasking_really_works.html The reasonable solution would be to implement a push notification and send a notification whenever there is an update on server. J R It is

Firebase authWithOAuthPopup returns TRANSPORT_UNAVAILABLE when using PhoneGap Cloud Build

余生颓废 提交于 2019-12-01 10:33:58
I have had success using the authWithOAuthPopup in my html5 application but when I recently created a phoneGap build, it fails on Android. I have done the obvious thus far that Ive found from other sources: Added sources to config.xml: <access origin="*.firebaseio.*" /> <access origin="https://auth.firebase.com" /> Ive also added the InAppBrowser plugin: <gap:plugin name="org.apache.cordova.inappbrowser" /> In my test, Im able to call window.open on my phone and get another web page to come up so I know the plugin seems to work. However, when I use the firebase code, Im unable to get any Auth

Clear Android's Local Notifications cordova plugin

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 10:29:02
I use Phonegap's localNotification Plugin for Android to show notifications on specific dates. I use Cordova [2.2] & I used cordova's upgrading tutorial to modify the plugin. The notification is displayed, but when I click on it, the application doesn't open and the notification isn't cleared. How can I fix this? In AlarmReceiver.java, around line 70, you will see the following lines of code: // Construct the notification and notificationManager objects final NotificationManager notificationMgr = (NotificationManager) systemService; final Notification notification = new Notification(R.drawable

Clear Android's Local Notifications cordova plugin

泪湿孤枕 提交于 2019-12-01 10:11:14
问题 I use Phonegap's localNotification Plugin for Android to show notifications on specific dates. I use Cordova [2.2] & I used cordova's upgrading tutorial to modify the plugin. The notification is displayed, but when I click on it, the application doesn't open and the notification isn't cleared. How can I fix this? 回答1: In AlarmReceiver.java, around line 70, you will see the following lines of code: // Construct the notification and notificationManager objects final NotificationManager

navigator.onLine not working cordova 5.0.0

狂风中的少年 提交于 2019-12-01 09:24:02
问题 I am having problems with checking if a device has no internet connection. I am using cordova 5.0.0 CLI. This is my code: if(navigator.onLine) { alert("online"); } else { alert("offline"); window.open("404.html"); } The problem is: it's always true. How can i fix it? I know this plugin, but I don't know how I even get it working. I know how to add plugins, but then it ends. Could someone help me getting this plugin working, or an alternative code to check if a user is offline? Thanks in

download and decompress a zip file in windows phone 8 application

偶尔善良 提交于 2019-12-01 09:15:23
问题 I am working on a windows phone 8 application (phonegap) which downloads a zip file from my server location, I want to unzip this file in my application at runtime to use the files in the archive. 回答1: You can use 3rd party libraries in order to decompress and extract ZIP files in WP7/WP8. The most common one is #ZipLib which you can download the WP7 port from @ http://slsharpziplib.codeplex.com/ My personal favourite library is DotNetZip which is a superset of #ZipLib and much more stable

How to use Phonegap with Ruby on rails 3

隐身守侯 提交于 2019-12-01 09:05:16
i am making a mobile web app with ruby on rails 3. how can i use phonegap at its best ? Any suggestions? The web app will be appearing native to the client. App consist of google maps api v3. Its the same MVC except V->html/erb with google map. Mindbreaker There are some posts you can take a look at: PhoneGap and rails 3: How to interact with a rails 3 app Rails 3 / PhoneGap: Converting a Rails app into an Phonegap iOS app? Using Phonegap as a native container for a Rails 3 App 来源: https://stackoverflow.com/questions/16809642/how-to-use-phonegap-with-ruby-on-rails-3

Phonegap : Camera view with background image

荒凉一梦 提交于 2019-12-01 08:27:29
I am using Phonegap with Sencha Touch to get camera functionality. But instead of the default camera view, I want a picture with transparent background to be overlaid upon the live camera view. Similar to below example where a dinosaur image has been overlaid upon the camera view image. Can you tell me whether this feature can be achieved with Phonegap or in any other way? It can be achieved but it requires a bit of native code and a simple trick. You need to set the phonegap container to transparent, and also add a surface behind your phonegap container. You use native code to initialize the

Firebase authWithOAuthPopup returns TRANSPORT_UNAVAILABLE when using PhoneGap Cloud Build

冷暖自知 提交于 2019-12-01 08:22:46
问题 I have had success using the authWithOAuthPopup in my html5 application but when I recently created a phoneGap build, it fails on Android. I have done the obvious thus far that Ive found from other sources: Added sources to config.xml: <access origin="*.firebaseio.*" /> <access origin="https://auth.firebase.com" /> Ive also added the InAppBrowser plugin: <gap:plugin name="org.apache.cordova.inappbrowser" /> In my test, Im able to call window.open on my phone and get another web page to come