Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9249797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:17:18+00:00 2026-06-18T10:17:18+00:00

I just need to hold onto some simple data in an iOS standalone web

  • 0

I just need to hold onto some simple data in an iOS standalone web app (using apple-mobile-web-app-capable etc). The data is defined when the user visits the site, and saved to localStorage.name etc. That same page is “saved to Home Screen” but when I get there, outputting localStorage.name etc returns undefined.

I go back to Safari and it still knows the information. I pull it up with my laptop’s Developer Console and I can still get all the data. It’s not even a different page, let alone a different domain or anything. Everything I read tells me that localStorage should (with minor caveats for modifying that data) be shared between Safari and the standalone app. What am I missing?

Here’s the gist of the code:

if (!window.navigator.standalone) {
    // show Safari content
    if (localStorage.name != void 0 && localStorage.var2 != void 0) {
        // show normal, "add this to your home screen" language -
        // this screen shows properly
    } else {
        // show "We weren't passed our variables" language
    }
} else {
    // Show standalone/offline content
    if (localStorage.name != void 0 && localStorage.var2 != void 0) {
        // Show normal standalone app content using localStorage variables.
        // I'm not seeing this.
    } else {
        // Show "error" text, which is what I'm getting
        document.body.removeChild(document.getElementById('container'));
        var helper = document.createElement('section')
            helper.id="helper"
        helper.innerHTML = '<h1>Sorry</h1>'
          +   '<p>There seems to be a problem with the app.</p>'
          +   '<pre>'
          +   "  Name: " + localStorage.name + "\n"
          +   "  var2: " + localStorage.var21 + "\n"
          +   '</pre>';
        document.body.insertBefore(helper,document.body.firstChild)
    }
}

For what it’s worth, I’m in iOS 6.1. So it shouldn’t be an “old” problem. What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T10:17:20+00:00Added an answer on June 18, 2026 at 10:17 am

    This comment: iOS 'Web App' has different localStorage than Mobile Safari

    …has the answer. The local storage is now entirely separate from Safari to the native app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need an efficient data structure to hold onto identifiers without the need for
Just need some quick clarification I have 2 Queries in my Access Database that
Just need get some vals located in application.ini(main ini) in the Controller plugin I
I just need some clarification on variables A normal variable has 2 parts to
I need some consultation here. I am a C# developer, and for just about
I am in need of extracting the app icon from an apk-file. I just
Just need a little bit of Javascript to warn people that press the back
I just need a help in configuring hiberclipse for my eclipse indigo version. Install
I just need to know if WCF is platform independent like Webservices? Can the
I just need to be pointed in the right direction - I can research

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.