The Daily Click ::. Forums ::. Klik Coding Help ::. Exporting data from iOS
 

Post Reply  Post Oekaki 
 

Posted By Message

joelr_2000



Registered
  22/02/2004
Points
  687
29th January, 2013 at 29/01/2013 04:04:04 -

Is it currently possible to upload/extract/send accumulated data in a game (ie. global vlaues etc) from an iOS application to an email, facebook, twitter or anything else. Has to be when it's being used on an ipad/iphone.

Is this a big ask?

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
29th January, 2013 at 29/01/2013 06:35:00 -

Nope easy as long as you have a server with php support and mail support.

Actually I made a simple php script for myself exactly for this purpose.
I was using it during testing to collect data, so it doesn't have decent security. I don't suggest using it in production as is. You might want to secure it first.


Paste this code into notepad and save the file as a .php then upload it to your server.
Be sure to change the value of the $to field to your email address.

<?php
$to = "email@domain.com";
$from_header = "From: ".$_GET['e']." <".$_GET['e'].">";
$subject = "Data - ".$_GET['v'];
$body = $_POST['d'];

if (mail($to, $subject, $body, $from_header)) {
die("s");
} else {
die("f");
}
?>

Next use the get object to send a request to this page and append the correct values.
The body of the email is done using a POST request. All the rest are GETs.

So first append the POST data using the get object then send a request that looks like this:

http:// "your web address" / "name of php file" ?e=useremail@domain.com&v=subject

That should do it!

EDIT: you can use this method to do anything really. As long as your server can perform the task of posting to twitter ect. Instead of using email it could use a database and then the app could request the data back later. You could make a built-in level editor and allow users to upload their levels and download other user's levels. It all depends on what you can make your server do.

Edited by UrbanMonk

 
n/a

joelr_2000



Registered
  22/02/2004
Points
  687
29th January, 2013 at 29/01/2013 07:02:50 -

Thanks for the response..

- What if I don't have server..? Can I use a public dropbox link?
- is it iOS compatible?

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
30th January, 2013 at 30/01/2013 07:14:46 -

You can't use dropbox.

You need a server that supports php. There are prolly free hosts out there you can use, but I don't recommend it for something you're going to sell.

I use rackspace cloud:
http://www.rackspace.com/cloud/

I rent for $12 a month.

Yes it's compatible.

Edited by UrbanMonk

 
n/a

joelr_2000



Registered
  22/02/2004
Points
  687
31st January, 2013 at 31/01/2013 04:06:48 -

Awesome thanks heaps for your help.

Last question: Is it possible to change what email address is in the php file from the app itself?

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
31st January, 2013 at 31/01/2013 23:32:41 -

Yes. Anything is possible as long as your server can do it. Heck you could make the script send text messages if you so desire.

To get the script to have a changeable email just modify the "$to" assignment.

Instead of "$to = "email@domain.com";"

Do this "$to = $_GET['t'];

and then add the t field to your get request.

I don't recommend placing this script on your server "as-is" since it isn't secured.
You need to find a library for stripping out bad characters and perhaps a key system to protect your server from script kiddies using it to send spam.

 
n/a

joelr_2000



Registered
  22/02/2004
Points
  687
6th February, 2013 at 06/02/2013 04:11:44 -

Hey dude, still not making much sense to me. Can you please show us an example mfa?

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
6th February, 2013 at 06/02/2013 20:11:32 -

What do you want the mfa to do? Send the get request?

Just add the get object to your frame and use the action "get url"

In the url field do:

"http:// *your domain* ?getvalue1=value"

It's that easy.

 
n/a

joelr_2000



Registered
  22/02/2004
Points
  687
11th February, 2013 at 11/02/2013 04:42:41 -

Get URL is just telling the app to look up the specific php file isnt it? So how do u know what data is being sent from the mmf app.
I want to be able to send global values for example.. how do u tell which values to send.

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
11th February, 2013 at 11/02/2013 16:58:33 -

You either add the data you want to send to the POST, or you append it to the url as I explained above.

Like this:
"http:// *your domain* ?getvalue1=value"

See the ? at the end. That is where you add the values. Then you extract the values in the php file.
If you add any more values you'll have to use the & sign.

So:

?value1=value&value2=value

ect.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click