I am developing a hybrid app using ionic framework.
I am trying to saving the data locally using sqlite.
I installed cordova sqlite using CLI.
I am getting:
an error Module com.brodysoft.sqlitePlugin.SQLitePlugin does not exist.
deviceready has not fired after 5 seconds.
Channel not fired: onPluginsReady
Channel not fired: onCordovaReady
I have read a lot of threads talking about this issue. All were pointing at the cordova.js.
I included it in my scripts but also nothing changed.
Any help?
Very Simple Just Add the Plugin (*Solved For me)
cordova plugin add https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git
deviceready event fires only once per webpage lifecycle.
This event is essential to any application. It signals that Cordova's device APIs have loaded and are ready to access.
Cordova consists of two code bases: native and JavaScript. While the native code loads, a custom loading image displays.
However, JavaScript only loads once the DOM loads. This means the web app may potentially call a Cordova JavaScript function before the corresponding native code becomes available.
The deviceready event fires once Cordova has fully loaded.
Credit for this answer goes to Mohamed Taman.
Details: http://cordova.apache.org/docs/en/3.5.0/cordova_events_events.md.html#deviceready
Related
I have made an angular + workbox application that now is converted using PWABuilder to Cordova project targeting ios platform.
Now my problem started with offline page, I want my application to work the same way it works on chrome browser with offline mode.
That is, even if I'm in offline mode, I'm able to use website and store the requests for later on.
But on IOS device, when I open application, then turn airplane mode or disconnect wifi and re-run an app a white screen appears. (Offline page support is disabled in manifest.js - I don't need Offline.html)
I have registered routing by
workbox.routing.registerNavigationRoute('/');
And then
// couple of following lines:
workbox.routing.registerRoute('regex with js,manifest...etc', networkFirstStrategy({cacheName} ...)
And the weird fact is that on ios this somehow can't be cached, or somethings different happens.
I'm waiting for any suggestions, or leads that can help me fix this behaviour.
Answer
The WebView as used by Cordova in the latest iOS (12.0.1) will not run Workbox because it doesn't support Service Workers.
Details
Cordova apps run in a WebView.
The app executes in a WebView within the native application wrapper... source
The WebView in the latest production iOS (12.0.1) only supports Service Workers within three specific contexts, which doesn't include Cordova apps.
At this time [the Service Worker API] is only available in Safari, applications that use SFSafariViewController, and web applications saved to your home screen. source
Next Steps
It may be possible to add Service Worker support via a Cordova Plugin. For example: cordova-plugin-service-worker.
In addition, you may also need to add Background Sync support as the latest Safari does not support Background Sync. For example: cordova-plugin-service-worker-background-sync.
The Workbox docs state that they provide a fallback strategy when Background Sync is not supported:
Workbox Background Sync...also implements a fallback strategy for browsers that
don't yet implement BackgroundSync. source
However, an open issue on Github shows that the fallback strategy may not work on iOS.
I have been trying to get AR.js to work within a web application that I am creating. I am building this application as a plugin that is subsequently loaded into a platform called BuildFire (buildfire.com). The app should just load as a web app inside of an iframe within the actual app itself. When I load my plugin, it comes up with an error saying:
Webcam Error
Name: NotReadableError
Message: Could not start video source
It works perfectly fine if I load the same code in a mobile browser window, but not within my web app when loaded in the context of the cordova iframe. Is there some permissions issue that is occurring where it can't access the camera in the same way the browser allows it to?
This is happening on Android on an S8, though I suspect the hardware doesn't matter too much in this case.
I am creating ios app using meteor and i have all the assets in the public folder, but still my app downloads assets from the server when it loads for the first time.
I am trying to stop auto reload or auto update on cordova.
I have tried this but didnt work.
if (Meteor.isCordova) {
Reload._onMigrate(function (retry) {
return [false];
});
}
I see two possibilities :
onMigrate
Use this on client side (/client folder)
Meteor._reload.onMigrate(function() {
return [false];
});
AUTOUPDATE_VERSION
$ AUTOUPDATE_VERSION=abc meteor
You can set the AUTOUPDATE_VERSION environment variable to something static, it will prevent autoupdate.
See Meteor Doc.
Edit note : mdg:reload-on-resume doesn't work on iOS. Issue #72.
Have you looked at the reload on resume package? Not on IOS at this time, sorry!
Add it to your Meteor app with meteor add mdg:reload-on-resume. This
package changes the behavior of Meteor's hot code push feature on
mobile devices only.
Normally, your app will update on the user's device as soon as you
push a new version. This process is always smooth in a desktop web
browser, but might momentarily interrupt the user's experience if they
are on a mobile device.
With this package, the app will only update itself to the newest
version if the user closes and re-opens the app (hence, it "reloads on
resume").
The Appcache package will stop your app downloading when it first loads
Once a user has visited a Meteor application for the first time and
the application has been cached, on subsequent visits the web page
loads faster because the browser can load the application out of the
cache without contacting the server first.
I have a mobile app built using phonegap +qx mobile 3.5.
I have a page implemented using qooxdoo mobile which has a header implemented using qooxdoo controls. The content section of the page is loading from an external system using a ajax call which returns a string(html+css). The html has built in click handlers which are not firing on ios. The html works fine when loaded directly without qx.
This is an existing app in android and seems to work fine there. Can someone help me get this working on ios?
EDIT : I am using native scroll and not the custom scroll plugin.
I believe this problem is caused by the used scrolling method.
If you just remove the macro "qx.mobile.nativescroll" out of your config.json,
qx.Mobile detects itself whether to use NativeScroll or iScroll.
In version 3.5 that means, Windows Phone 8 and iOS7 are using the native scrolling.
Do not forget to rebuild after removal.
I have a PhoneGap app and it checks your location every 5 minutes and reports it back etc.. to do this When the app needs to run in put at the background .
For Android I have written native code but for iOS will this work?
I'm not even sure how you would implement native objective c into PhoneGap as they are very different compilers etcthe it pause.
Any advice would be appreciatedWhen it come back to front, it will resume all remaining operation.
You need to write a Plugin to do this. A plugin will allow you to write Objective-C code and link it back to a JS function. Here are a few tutorials:
From Apache
From Adobe
Another
Here is also a big list of Plugins people have already created: iOS Plugins