I have been fighting with Cordova for the last couple of days, and now I’ve come to the realization that the app works fine when developing it but it breaks in production.
It does seem like it has something to do with the minification as it breaks when I run: meteor run ios-device --settings ./private/settings.json --production
but it works fine when I run: meteor run ios-device --settings ./private/settings.json
I’ve attached safaris debugger and the issue seems to be in the code for my map (svelte-maplibre) Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'g.context')
It works fine if I open the Safari browser in the iPhone and run the localhost url so it is just in Cordova this is an issue.
Is there anyway to circumvent this, or should I throw Cordova out the door and go with some other PWA app hosting solution and hope that it solves the issue?
Looks like an object (google maps?) is not properly loaded/executed before displaying the map.
Depends on your needs regarding Cordova. There is a lot of things PWA can now do but there are still specific circumstances or packages that will need Cordova e.g. hardware access/solutions. For the majority of web apps, PWA will suffice.
I’ve decided to use https://www.pwabuilder.com to build an Xcode project and then use that instead. I did in 1 hour what I’ve tried to fix for days with Cordova and it all works great. Even integrated firebase easily. Hopefully meteor will integrate capacitor in the future as a better alternative.
Hi there, Just wanted to let you know that for PWAs we have web workers (here in the Meteor community) for Push notifications and for caching of Meteor assets and other assets/files. But I guess you still rely on a hybrid technology as I see you still use Xcode in the process.
I heard that web push isn’t as powerful as the native push, that’s why I decided to just do a small integration between swift and meteor (was already half implemented in the sample project from pwabuilder)
Web Push, might not be as powerful, but it really depends on your needs. Sometimes, the 6L V12 engine might not be suitable for a … taxi car. The package I have activitree:push implements Push with FCM (google). The documentation on FCM website is amazing for all devices, including Web on various platforms/devices.
Here you can see my main SW that ensures refreshing of Meteor assets as they change versions with new deployments. Besides this, I use, indeed, an edge/CDN caching with AWS Cloudfront.
This is a Meteor specific SW. I am not sure PWABuilder would offer something with such specificity.
Try disabling minification for debugging (--production --debug) or checking if the library needs specific build settings. If it’s a Cordova-specific issue, switching to a PWA might be a cleaner long-term solution. You might also want to check out iOS app development services if you’re considering a more stable mobile solution.