Suunto app Forum Suunto Community Forum
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Plus App Custom user settings

    Scheduled Pinned Locked Moved Suunto Plus Development
    3 Posts 2 Posters 103 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Markus HornofM Offline
      Markus Hornof
      last edited by

      Hello everyone!

      I am struggling to implement custom settings for a Suunto Plus app.
      I’d like to add a drop down menu, where the user can select 3 color themes.

      Data.json
      {
      “appSettings”: { “centerValues”: false },
      “colorTheme”: { “names”: [“classic”, “pink”, “purple”], “value”: 0 }
      }

      Manifest.json
      “settings”: [
      { “shownName”: “Center values”, “path”: “appSettings.centerValues”, “type”: “boolean” },
      { “shownName”: “Pick color theme”, “path”: “colorTheme.value”, “type”: “enum”, “valuePath”: “colorTheme.names” }
      ],

      The HEX values are in the html template onActivate:

      var ct=localStorage.getItem(‘colorTheme.value’);
      var hrColor=(ct===‘1’)?‘#EF009C’:(ct===‘2’)?‘#5700C2’:‘#CC2200’;
      _accentColor=(ct===‘1’)?‘#FF422F’:(ct===‘2’)?‘#F83607’:‘#FFDE31’;

      Ideas anyone? Or is Enum not supported at all?

      Many thanks,
      Markus

      1 Reply Last reply Reply Quote 0
      • M Offline
        matram Bronze Member
        last edited by

        The manual provides an example of using an Enum, so that cannot by itself be the problem.

        What kind of error are you getting.

        Do not know if it is relevant here. But I had to init settings in code like below. I initially thought the data file was sufficient to do this but it seems not.

          // Load app settings
          settings = localStorage.getObject("appSettings");
        
          // Create default settings if none found
          if (settings == null) {
            settings = {
              targetPaceWarm: 2.326,
              targetPaceInterval: 2.857,
              targetPaceRecovery: 2.083,
              targetPaceCool: 2.083,
        
              durationWarm: 10,
              durationInterval: 12,
              durationRecovery: 5,
              durationCool: 20,
        
              repeatCount: 2
            }
          }
        
        1 Reply Last reply Reply Quote 0
        • Markus HornofM Offline
          Markus Hornof
          last edited by

          I suddenly worked, after a few times uninstall/install the same app build.
          Seems like there is a problem with stale versions…

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post

          Suunto Terms | Privacy Policy