Hello Creo's
I need to load data from HTTPRequest (for example from Spotify) and make it available when device offline
maybe we could use HTTPRequest than SQLite to save data but I need to know how we connect them together
Thanks in advance
Hello Creo's
I need to load data from HTTPRequest (for example from Spotify) and make it available when device offline
maybe we could use HTTPRequest than SQLite to save data but I need to know how we connect them together
Thanks in advance
Hi @Roayati can you please let us know what kid of data are you trying to get from Spotify?
I need to save song information such us (name, artist, album .. etc) and save to for Offline use
@marco ?!
You can save all that information in a sqlite database.
Do you have a sample project to show me?
@marco !?
In Request -> NewValue event write the following code:
var n = value["resultCount"]; var r = value["results"]; for (var entry in r) { var artistId = entry["artistId"]; var artistName = entry["artistName"]; var trackName = entry["trackName"]; Console.write("\(artistName) \(trackName)"); }
entry is a dictionary extracted from the JSON result set, and each key of the dictionary corresponds to the key of the JSON result (that you can see from the preview panel).
Once you extracted the fields you are interested on then you can serialise them to an sqlite database and then reuse it when network connection if off.
Please note that in order to trigger the NewValue event one the simulator you have to pull to refresh the tableView (issue will be fixed in the next version). This trick is not necessary on a real device.