Skip to content

Undefined data in iOS when trying to store data #145

@sts-ryan-holton

Description

@sts-ryan-holton

I've installed the latest version of this plugin into my Cordova / Nuxt JS project. I'm trying to store some data when I click a button, and alert the data back when a different button is clicked:

<template>
  <div class="fill-height has-safe-area-top">
    <v-container>
      <v-layout row pb-2>
        <v-flex>
          <h1>Native storage test</h1>
          <v-btn @click="storeData">Store</v-btn>
          <v-btn @click="getData">Get</v-btn>
        </v-flex>
      </v-layout>
    </v-container>
  </div>
</template>

<script>
export default {
  methods: {

    storeData() {
      NativeStorage.initWithSuiteName("suitename");
      NativeStorage.setItem("reference_to_value", "my value");
    },

    getData() {
      alert(NativeStorage.getItem("reference_to_value"))
    }

  }
}
</script>

This seems to return undefined on the alert() when testing on a physical device compiled in Xcode 10.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions