Issues on Storage Sync API

389 views
Skip to first unread message

Luigino De Togni

unread,
Apr 17, 2014, 6:56:41 AM4/17/14
to chromi...@chromium.org
Hi,
in my packaged app i'm using Storage Sync API to set/get data.

Functions used are

// read from google sync
chrome.storage.sync.get("mySettings", function(items) {
        
        if (items.mySettings === undefined){

            //init my myLocalSettings
        }else {
            
            myLocalSettings = items.mySettings;
        }

        console.log("ok settings loaded");

);

and

// saves to Google Sync
chrome.storage.sync.set({"mySettings": myLocalSettings}, function() {

            // Notify that we saved.
            console.log("ok settings saved");

});


But i noticed that if a load my packaged app from another pc data is not synchronized (chrome.storage.sync.get returns mySettings as undefined variable)

Anyone can help me please?

Thank you!

Lewix


David Brodbeck

unread,
Apr 17, 2014, 3:47:27 PM4/17/14
to Chromium Apps
a) Are you signed in?  You have to be signed in for sync to work.
b) Are you loading this as an unpackaged app?  Sync'd data is tied to the app ID, and unpackaged apps will get a different app ID every time they're installed, unless you specify one in the manifest.json file.


--
You received this message because you are subscribed to the Google Groups "Chromium Apps" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-app...@chromium.org.
To post to this group, send email to chromi...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-apps/.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.



--
GPG Key Fingerprint: 0DB7 4B50 8910 DBC5 B510 79C4 3970 2BC3 2078 D875

Luigino De Togni

unread,
Apr 17, 2014, 5:59:46 PM4/17/14
to chromi...@chromium.org
a) Are you signed in?  You have to be signed in for sync to work.
Yes!

b) Are you loading this as an unpackaged app? 
Yes!

Sync'd data is tied to the app ID, and unpackaged apps will get a different app ID every time they're installed, unless you specify one in the manifest.json file.
Thank you! Now it's clear :)

Then i think debugging Storage Sync API isn't easy between different workstations if i use an unpackaged app.

Thank you again!
Reply all
Reply to author
Forward
0 new messages