#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    45
    Rep Power
    3

    Check if app is installed on mobile devices


    Is it possible to check if an app is installed on the iphone or android using PHP? I've found solutions using Javascript but was just wondering how it could be done in PHP.
  2. #2
  3. No Profile Picture
    I haz teh codez!
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2003
    Posts
    2,549
    Rep Power
    2337
    No. You have a fundamental misunderstanding of PHP. PHP runs on the server. It creates HTML and/or JavaScript and sends it to the requesting client. It cannot access anything on the client, unless the client sends it information.
    I ♥ ManiacDan & requinix

    This is a sig, and not necessarily a comment on the OP:
    Please don't be a help vampire!
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    45
    Rep Power
    3
    Originally Posted by ptr2void
    No. You have a fundamental misunderstanding of PHP. PHP runs on the server. It creates HTML and/or JavaScript and sends it to the requesting client. It cannot access anything on the client, unless the client sends it information.
    So you can only detect which mobile device a user is using but you cannot check if a certain app is installed on the mobile device?
  6. #4
  7. No Profile Picture
    I haz teh codez!
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2003
    Posts
    2,549
    Rep Power
    2337
    Correct, because the browser is sending a User-Agent string that allows you to identify the browser being used, from which you can deduce (if the browser's not lying) what the device is. I don't think a mobile browser will send you its list of installed apps willingly; seems a security breach to me, but I don't do mobile development.
    I ♥ ManiacDan & requinix

    This is a sig, and not necessarily a comment on the OP:
    Please don't be a help vampire!
  8. #5
  9. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    You can't get a list of apps because the browser would need special filesystem permissions which would throw a bunch of red flags while actually installing the thing.

    When I install a browser on my phone, the phone alerts me that the browser is requesting permission to access certain things on the phone (internet connection, control of screen brightness, key overloading, etc). It would need further permissions to see open/installed apps, that's a whole other set of permissions.

    Also, my phone identifies as firefox 10 for windows.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    45
    Rep Power
    3
    Originally Posted by ptr2void
    Correct, because the browser is sending a User-Agent string that allows you to identify the browser being used, from which you can deduce (if the browser's not lying) what the device is. I don't think a mobile browser will send you its list of installed apps willingly; seems a security breach to me, but I don't do mobile development.
    Thank you for the explanation. I assumed that if I could detect devices I could also detect if a certain app is installed on said device with PHP. I'll have to look into the Javascript solution.
  12. #7
  13. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    I'd be surprised if it's possible to do that from JavaScript.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  14. #8
  15. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    Originally Posted by E-Oreo
    I'd be surprised if it's possible to do that from JavaScript.
    Me too. The only time it can be done is from a stand-alone app that runs as a system service and has special permissions.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

IMN logo majestic logo threadwatch logo seochat tools logo