I have an custom class object in my cocos2d game and I want to store it on the server, along with PNG image and some id parameters.
Currently this object saved and loaded using NSKeyedArchiver on the actual device or simulator. But I need a server! :p
I'm not familiar with PHP, so I've asked one my friend to create a simple server for me, and now I've some server that can accept requests... so now my turn - upload data.
So, I'm trying to find a simple solution and came with AFNetworking, however I can't find useful example that help me out.
My question is: how to send my custom object to server along with parameters:
- Id (NSString),
- userName (NSString,
- image (png file save locally on the device)
And server can store this data and provide me id or link to this object (this part I believe must be done on a server side), so I can download it from server later and use this data in my game.
EDIT: I'm assuming, request would be formed from 4 "parts":
- custom object(NSData)
- id (NSString)
- userName (NSString)
- image file (local png file)
But, how to make all these in one request and send? Also, after that, I will send request to server like just GET: www.server.com/id and server will return me:
- my custom object(NSData)
- userName (NSString)
- PNG image file