0

I am working on a phonegap app that will be submitted to the itunes store and am having trouble deciding how I should send data stored in localstorage to a remote server. I would like to use json to do this but have never done so. My questions are: am I right to want to use json and use a php file on the remote server that will accept it as GET (or is POST better) and what issues should I be aware of when submitting this for review through itunes?

zach
  • 478
  • 1
  • 5
  • 15

2 Answers2

1

You won't be using JSON to send the information to the server. You'll be sending the information using query string parameters and you can use any of the HTTP verbs to do this, there is a great question here with an explanation and more resources.

The server side tech you want to use is up to you, PHP is a fine choice. You should use whichever verb in PHP to reference the params you send, the most popular of these is $_GET and $_POST. POST is generally used when you send some private information such as CC details.

There are no issues with this approach regarding app store approval. Making a request to a web service from an app is completely normal.

Community
  • 1
  • 1
sciritai
  • 3,688
  • 1
  • 17
  • 22
  • I wouldn't go out of my way to translate that JSON to query string parameters. Just POST the json in one go. That way when the JSON changes your posting code doesn't need to change. – Andy Smith Dec 05 '16 at 09:38
0

Try these sample : Phonge gap Demo to call PHP api

Jigar Tank
  • 1,654
  • 1
  • 14
  • 24