Closed yaronyg closed 8 years ago
Can't seem to call 'Mobile.getDocumentsPath' within jxcore/app.js getting Mobile is undefined
As you can see from the console log below jxcore engine is started so it should be available?
JXcore Cordova bridge is ready!
JXcore engine is started
starting app.js
Error!: Mobile is undefined
Um.... AHHHHH!!! How is this even theoretically possible? Can you point me at what branch you are using? This one is just weird.
Story_0 / Story_0_dadougla
Ok -- got it working. L#19 var Mobile = require('thali/mockmobile.js');
within the conditional statement for desktop development env was causing the problem. It shouldn't be getting triggered in native land!
Now database is being saved after app shutdown - as you can see the app container shows the pouchdb being saved in Documents folder.
Android documents location path:
pkg: /data/local/tmp/org.thaliproject.postcardapp
I/jxcore-log﹕ Mobile Documents dbPath location: /data/data/org.thaliproject.postcardapp/files/dbPath
If we are good then let's close this issue.
Ok, I'll check in the change which works great on iOS. But as a side effect I've had to comment out the require line to mockmobile for desktop until I figure out what is going on with that exactly.
Moved to done. Pushed to branch story_0_dadougla
Could do with logout / delete db button now? Re-installs preserve the app data so you have to manually delete the apps if you want a clean install for testing.
I'm confused. I assumed that we actually need this because otherwise there is no way to start a test clean without uninstalling and re-installing the app?
Right now we put leveldown into temp directory on iOS so it gets randomly deleted. We need to instead use Mobile.getDocumentsPath