this could very well be a separate XCode class (with it's .m and .h or any other needed files), and any configuration
required (e.g.: [url removed, login to view] parameters or frameworks to be added) for us to include it in our app.
For this case, here's how it needs to work. The created class will need the following methods:
1) A "saveData" method to store this data locally. This method must save the
following information, which later will be sent to the "uploadData" method below:
saveData(NSString *str1, NSMutableDictionary *dict1, NSInteger int1, NSInteger int2, NSString *str2, id delegate)
We'll pass all this information to the saveData method for local storage.
The class should be checking regularly for internet connection (the frequency should be easily changed by us, so it should be clearly marked) and, when it finds internet, it uploads the data (item 3 below).
3) Whenever there's internet available, an "uploadData" method should be
called to upload the next available data. That uploadData method is already done, so you'll need to provide a dummy in a separate .h and .m and we'll replace it with our method. It will look like this:
uploadData(NSString *str1, NSMutableDictionary *dict1, NSInteger int1, NSInteger int2, NSString
*str2, id delegate, int dataId);
The last parameter, dataId, is a unique number you should send to identify the data in the internal database, in order to flag it as uploaded later.
4) Once the upload is done successfully on our end, we will call another method from your created class
to confirm that item has been uploaded correctly and should be flagged as uploaded. For example:
Once this method is called, that record should be flagged as uploaded and should no longer be sent for upload. Then, the program should go back to item 2 for another
There's also another method we'll need:
When we call this method, all items flagged as uploaded should be deleted from the local database.