Detect web app running as homescreen app on Android Stock Browser











up vote
4
down vote

favorite
1












We are building a web app that has to be used as a standalone / homescreen app. In Chrome and Safari we can detect if it is viewed from the browser or from native-like browser container with either window.navigator.standalone or window.matchMedia('(display-mode: standalone)'). Neither option seems to work with the default Android stock browser/Samsung Internet. Furthermore, we are also not able to use start_url in manifest.json, because we need to pass a token to the homescreen app that is unique per user.



Is it possible to detect if the app is opened from the homescreen when it was added using the android stock browser?



Related





  • Check if web app is added to home screen on Android (works only with chrome on android)


  • Detect if page is viewed in samsung stock browser or as a standalone web app (unanswered)

  • Bug report: Does not detect the display-mode style










share|improve this question
























  • Hmmm.... does Samsung Internet even support your manifest.json? Unless you're specifically targeting Samsung phones, I'd hope most of them would either have Chrome or Firefox installed -- otherwise, it doesn't look like there's much you can do here. Can you expand on your start_url hangup? Why can't you generate a manifest with user_token=xxx&pwa=true, and then parse that out with JavaScript?
    – Sheng Slogar
    Nov 19 at 16:33










  • The user receives an email with a link containing the user token. That means the user token is only known at the client side at that time. Technically I could use php at the server end to get the user token out of the query string and return it in a custom manifest.json when the client requests it - or maybe even more aweful, set a cookie that is then sent back with the manifest.json call. Neither option is great - or very reliable I think. Currently manifest.json is identical for all users.
    – Sumurai8
    Nov 19 at 16:52










  • Probably your best bet, only include your manifest once a user is logged in and include that in your start_url, assuming the token is permanent since you wouldn't be able to launch your installed web app from an email link.
    – Sheng Slogar
    Nov 19 at 16:58










  • Anything supporting your manifest should support matchMedia though.... So I'm guessing Samsung/native Android web is just creating a bookmark-style shortcut? Obviously not an expert here, hopefully someone more experienced can add to this.
    – Sheng Slogar
    Nov 19 at 17:01












  • Interestingly enough it is not a bookmark as it would have the address bar if it was. There is a bug with the display-mode setting of the browser which is causing the issue we are having, but other than that I have not found much else yet.
    – Sumurai8
    Nov 19 at 19:23















up vote
4
down vote

favorite
1












We are building a web app that has to be used as a standalone / homescreen app. In Chrome and Safari we can detect if it is viewed from the browser or from native-like browser container with either window.navigator.standalone or window.matchMedia('(display-mode: standalone)'). Neither option seems to work with the default Android stock browser/Samsung Internet. Furthermore, we are also not able to use start_url in manifest.json, because we need to pass a token to the homescreen app that is unique per user.



Is it possible to detect if the app is opened from the homescreen when it was added using the android stock browser?



Related





  • Check if web app is added to home screen on Android (works only with chrome on android)


  • Detect if page is viewed in samsung stock browser or as a standalone web app (unanswered)

  • Bug report: Does not detect the display-mode style










share|improve this question
























  • Hmmm.... does Samsung Internet even support your manifest.json? Unless you're specifically targeting Samsung phones, I'd hope most of them would either have Chrome or Firefox installed -- otherwise, it doesn't look like there's much you can do here. Can you expand on your start_url hangup? Why can't you generate a manifest with user_token=xxx&pwa=true, and then parse that out with JavaScript?
    – Sheng Slogar
    Nov 19 at 16:33










  • The user receives an email with a link containing the user token. That means the user token is only known at the client side at that time. Technically I could use php at the server end to get the user token out of the query string and return it in a custom manifest.json when the client requests it - or maybe even more aweful, set a cookie that is then sent back with the manifest.json call. Neither option is great - or very reliable I think. Currently manifest.json is identical for all users.
    – Sumurai8
    Nov 19 at 16:52










  • Probably your best bet, only include your manifest once a user is logged in and include that in your start_url, assuming the token is permanent since you wouldn't be able to launch your installed web app from an email link.
    – Sheng Slogar
    Nov 19 at 16:58










  • Anything supporting your manifest should support matchMedia though.... So I'm guessing Samsung/native Android web is just creating a bookmark-style shortcut? Obviously not an expert here, hopefully someone more experienced can add to this.
    – Sheng Slogar
    Nov 19 at 17:01












  • Interestingly enough it is not a bookmark as it would have the address bar if it was. There is a bug with the display-mode setting of the browser which is causing the issue we are having, but other than that I have not found much else yet.
    – Sumurai8
    Nov 19 at 19:23













up vote
4
down vote

favorite
1









up vote
4
down vote

favorite
1






1





We are building a web app that has to be used as a standalone / homescreen app. In Chrome and Safari we can detect if it is viewed from the browser or from native-like browser container with either window.navigator.standalone or window.matchMedia('(display-mode: standalone)'). Neither option seems to work with the default Android stock browser/Samsung Internet. Furthermore, we are also not able to use start_url in manifest.json, because we need to pass a token to the homescreen app that is unique per user.



Is it possible to detect if the app is opened from the homescreen when it was added using the android stock browser?



Related





  • Check if web app is added to home screen on Android (works only with chrome on android)


  • Detect if page is viewed in samsung stock browser or as a standalone web app (unanswered)

  • Bug report: Does not detect the display-mode style










share|improve this question















We are building a web app that has to be used as a standalone / homescreen app. In Chrome and Safari we can detect if it is viewed from the browser or from native-like browser container with either window.navigator.standalone or window.matchMedia('(display-mode: standalone)'). Neither option seems to work with the default Android stock browser/Samsung Internet. Furthermore, we are also not able to use start_url in manifest.json, because we need to pass a token to the homescreen app that is unique per user.



Is it possible to detect if the app is opened from the homescreen when it was added using the android stock browser?



Related





  • Check if web app is added to home screen on Android (works only with chrome on android)


  • Detect if page is viewed in samsung stock browser or as a standalone web app (unanswered)

  • Bug report: Does not detect the display-mode style







javascript android android-browser






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 at 19:01

























asked Nov 19 at 16:07









Sumurai8

12.9k83160




12.9k83160












  • Hmmm.... does Samsung Internet even support your manifest.json? Unless you're specifically targeting Samsung phones, I'd hope most of them would either have Chrome or Firefox installed -- otherwise, it doesn't look like there's much you can do here. Can you expand on your start_url hangup? Why can't you generate a manifest with user_token=xxx&pwa=true, and then parse that out with JavaScript?
    – Sheng Slogar
    Nov 19 at 16:33










  • The user receives an email with a link containing the user token. That means the user token is only known at the client side at that time. Technically I could use php at the server end to get the user token out of the query string and return it in a custom manifest.json when the client requests it - or maybe even more aweful, set a cookie that is then sent back with the manifest.json call. Neither option is great - or very reliable I think. Currently manifest.json is identical for all users.
    – Sumurai8
    Nov 19 at 16:52










  • Probably your best bet, only include your manifest once a user is logged in and include that in your start_url, assuming the token is permanent since you wouldn't be able to launch your installed web app from an email link.
    – Sheng Slogar
    Nov 19 at 16:58










  • Anything supporting your manifest should support matchMedia though.... So I'm guessing Samsung/native Android web is just creating a bookmark-style shortcut? Obviously not an expert here, hopefully someone more experienced can add to this.
    – Sheng Slogar
    Nov 19 at 17:01












  • Interestingly enough it is not a bookmark as it would have the address bar if it was. There is a bug with the display-mode setting of the browser which is causing the issue we are having, but other than that I have not found much else yet.
    – Sumurai8
    Nov 19 at 19:23


















  • Hmmm.... does Samsung Internet even support your manifest.json? Unless you're specifically targeting Samsung phones, I'd hope most of them would either have Chrome or Firefox installed -- otherwise, it doesn't look like there's much you can do here. Can you expand on your start_url hangup? Why can't you generate a manifest with user_token=xxx&pwa=true, and then parse that out with JavaScript?
    – Sheng Slogar
    Nov 19 at 16:33










  • The user receives an email with a link containing the user token. That means the user token is only known at the client side at that time. Technically I could use php at the server end to get the user token out of the query string and return it in a custom manifest.json when the client requests it - or maybe even more aweful, set a cookie that is then sent back with the manifest.json call. Neither option is great - or very reliable I think. Currently manifest.json is identical for all users.
    – Sumurai8
    Nov 19 at 16:52










  • Probably your best bet, only include your manifest once a user is logged in and include that in your start_url, assuming the token is permanent since you wouldn't be able to launch your installed web app from an email link.
    – Sheng Slogar
    Nov 19 at 16:58










  • Anything supporting your manifest should support matchMedia though.... So I'm guessing Samsung/native Android web is just creating a bookmark-style shortcut? Obviously not an expert here, hopefully someone more experienced can add to this.
    – Sheng Slogar
    Nov 19 at 17:01












  • Interestingly enough it is not a bookmark as it would have the address bar if it was. There is a bug with the display-mode setting of the browser which is causing the issue we are having, but other than that I have not found much else yet.
    – Sumurai8
    Nov 19 at 19:23
















Hmmm.... does Samsung Internet even support your manifest.json? Unless you're specifically targeting Samsung phones, I'd hope most of them would either have Chrome or Firefox installed -- otherwise, it doesn't look like there's much you can do here. Can you expand on your start_url hangup? Why can't you generate a manifest with user_token=xxx&pwa=true, and then parse that out with JavaScript?
– Sheng Slogar
Nov 19 at 16:33




Hmmm.... does Samsung Internet even support your manifest.json? Unless you're specifically targeting Samsung phones, I'd hope most of them would either have Chrome or Firefox installed -- otherwise, it doesn't look like there's much you can do here. Can you expand on your start_url hangup? Why can't you generate a manifest with user_token=xxx&pwa=true, and then parse that out with JavaScript?
– Sheng Slogar
Nov 19 at 16:33












The user receives an email with a link containing the user token. That means the user token is only known at the client side at that time. Technically I could use php at the server end to get the user token out of the query string and return it in a custom manifest.json when the client requests it - or maybe even more aweful, set a cookie that is then sent back with the manifest.json call. Neither option is great - or very reliable I think. Currently manifest.json is identical for all users.
– Sumurai8
Nov 19 at 16:52




The user receives an email with a link containing the user token. That means the user token is only known at the client side at that time. Technically I could use php at the server end to get the user token out of the query string and return it in a custom manifest.json when the client requests it - or maybe even more aweful, set a cookie that is then sent back with the manifest.json call. Neither option is great - or very reliable I think. Currently manifest.json is identical for all users.
– Sumurai8
Nov 19 at 16:52












Probably your best bet, only include your manifest once a user is logged in and include that in your start_url, assuming the token is permanent since you wouldn't be able to launch your installed web app from an email link.
– Sheng Slogar
Nov 19 at 16:58




Probably your best bet, only include your manifest once a user is logged in and include that in your start_url, assuming the token is permanent since you wouldn't be able to launch your installed web app from an email link.
– Sheng Slogar
Nov 19 at 16:58












Anything supporting your manifest should support matchMedia though.... So I'm guessing Samsung/native Android web is just creating a bookmark-style shortcut? Obviously not an expert here, hopefully someone more experienced can add to this.
– Sheng Slogar
Nov 19 at 17:01






Anything supporting your manifest should support matchMedia though.... So I'm guessing Samsung/native Android web is just creating a bookmark-style shortcut? Obviously not an expert here, hopefully someone more experienced can add to this.
– Sheng Slogar
Nov 19 at 17:01














Interestingly enough it is not a bookmark as it would have the address bar if it was. There is a bug with the display-mode setting of the browser which is causing the issue we are having, but other than that I have not found much else yet.
– Sumurai8
Nov 19 at 19:23




Interestingly enough it is not a bookmark as it would have the address bar if it was. There is a bug with the display-mode setting of the browser which is causing the issue we are having, but other than that I have not found much else yet.
– Sumurai8
Nov 19 at 19:23

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53378576%2fdetect-web-app-running-as-homescreen-app-on-android-stock-browser%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53378576%2fdetect-web-app-running-as-homescreen-app-on-android-stock-browser%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

If I really need a card on my start hand, how many mulligans make sense? [duplicate]

Alcedinidae

Can an atomic nucleus contain both particles and antiparticles? [duplicate]