As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
It might help to put the `navigator.onLine` if-statement inside the `promise.then(...)` handler, since `$kinvey.Sync.online` depends on the library being initialized.
O
OhmzTech
said
over 9 years ago
See the answer @Mark provided, depending on the Android version you are using, chances are navigator.isOnline has not yet registered when it hits your if statement. Try setting up an event listener and when the online event happens, then do Kinvey.Sync.online.
Thanks for your ideas. Sadly they are not helping though
Moved to using sync: { enable: true, online: navigator.onLine} because that is as per the Kinvey docs. (hence no longer using the sync.online before or after the promise)
I have a feeling its something to do with the persistence updates when doing a user update. I note the user update is quite different to a data update in the library. (one has res: true, one has req: true, res:true).......
What would be helpful would be reassurance that
a) { enable: true, online: navigator.onLine} on the init
b) var user_promise = $kinvey.User.update(user) (NO refresh:true , no offline:true..... I don't think required)
c) On Android, using Angular library
All works as a combination..... then I know its in my code. Right now I am still not sure if its my code, or the Angular library.
Anyone else got Android / Angular / Offline working as a combination?
Thanks!
l
lawrencepn
said
over 9 years ago
I'm experiencing the same problem, Kinvey sync with angular works just fine in chrome while testing but doesn't work on android, I've also tried the above suggested solutions with no success.
A
A B
said
over 9 years ago
For clarification / additional info I am testing on Android 4.2
Still pretty sure something is not quite right with local / net persistence returning to the update user function.....
M
Mark
said
over 9 years ago
When your app is offline, user entities cannot be updated using `$kinvey.User.update`. If you try to update anyway, a network request will be fired which will (obviously) fail.
A
A B
said
over 9 years ago
Hi Mark
App very much online, just sync is in enabled state
According to the library code, should update online (which it does actually, looking at the data in the console), and then fall back to also saving locally (which is failing, I think, and forcing the app to quit the error is so strong)
M
Mark
said
over 9 years ago
Interesting, yes, it should update the local data when the update online succeeds. Since you mention the app just quits, can you get a hold of the actual error it quits upon?
Not saying they are all the same problem but its getting beyond a co-incidence that these 3 independently noted problems are all on the same functionality combination
A
A B
said
over 9 years ago
The answer to all of this can be found on https://support.kinvey.com/discussion/201272210/e-sqlitelog-11951-1-statement-aborts-at-2-vacuum-cannot-vacuum-sql-statements-in-progress
A B
All works fine on IOS browser (Safari), desktop browser (Safari, Chrome) but fails on Android browser (webview)
var promise = $kinvey.init({
appKey: "abcdef",
appSecret: "abcdef",
sync: { enable: true, online: false}
})
if (navigator.onLine) {
$kinvey.Sync.online();
}
However, if you do sync **enable: false, online:false**, it works fine on Android browser (webview).
Is there a problem here with the Angular library? Thanks!