There is a mobile application for iOS and Android created with: Framework7 + PhoneGap

A mobile application makes HTTP requests to a site that is written in PHP .

How does the PHP site uniquely identify an HTTP request from the PhoneGap mobile app?

ps: it is not possible to write separate requests or add some GET variable to requests, there are many interfaces like requests ...


Solution of the problem:

Use in config.xml the line:

<preference name="AppendUserAgent" value="Ваше добавочное значение" /> 

Well, then in PHP on the server look at the presence of this additional value in $ _SERVER ['HTTP_USER_AGENT']

    1 answer 1

    The correct way is to put yourself in the "right User Agent". This can be done literally in one line :

     <preference name="OverrideUserAgent" value="MyBaggyApp/1.2.3" /> 

    Everything, now on the server will be very easy to distinguish (and how to read the User Agent even the weak June knows).

    Now you can transfer the type of axis (android / iOs), version of the application (or even better version of the protocol).

    • I replaced the UserAgent header with my own value, I have the Framework7 interface now scaled to full screen, overlapping the top status panel (where is the battery, the clock, etc.). Is it possible to add your value to the original UserAgent header and not to completely rewrite it? - Enshtein
    • instead of OverrideUserAgent, I tried: AppendUserAgent, and even then they have in: cordova.apache.org/docs/en/5.1.1/guide/platforms/android/… written: "OverrideUserAgent (string, not set by default): If It’s helpful to identify the users of the webview. Safer to use: AppendUserAgent - Enshtein
    • let alone find in $ _SERVER ['HTTP_USER_AGENT'] the occurrence of the words I need, of course I can). Thank you for the tip! - Enshtein