{"id":60,"date":"2016-08-12T22:10:41","date_gmt":"2016-08-13T05:10:41","guid":{"rendered":"http:\/\/www.nemo10.net\/blog\/?p=60"},"modified":"2016-08-12T22:10:41","modified_gmt":"2016-08-13T05:10:41","slug":"app-update-august-12-2016","status":"publish","type":"post","link":"http:\/\/www.nemo10.net\/blog\/app-update-august-12-2016\/","title":{"rendered":"App update &#8211; August 12, 2016"},"content":{"rendered":"<p>I quit my job to build an app and start a startup!<\/p>\n<p>It&#8217;s been a few weeks and I&#8217;ve been posting updates to Facebook, but today I feel like updating my WordPress!<\/p>\n<p>According to my git commits, here&#8217;s what I did this week:<\/p>\n<ul>\n<li>Check-ins are now associated with shows instead of venues (obvious in retrospect)<\/li>\n<li>If there&#8217;s a show happening right now, the app will get a list of all checked-in users and flag them when they participate in chat.<\/li>\n<li>Users can now change their display name via the Settings\/Profile screen<\/li>\n<li>Added\u00a0support for different types of shows (IE regular show, secret show, appearance w\/o music, invite-only shows, etc.)<\/li>\n<li>Added a leaderboard to the app that fetches on app startup but can be reloaded via pull-down-to-reload pattern<\/li>\n<li>App now knows which users are band members so they can be highlighted in chat<\/li>\n<li>Refactored all client and server request handling code to use JSON for client requests (previously was url-encoded string, which was working until I needed to send an array!)<\/li>\n<li>Added &#8220;heartbeat&#8221; code that automatically grabs chat and check-in info every ten seconds. It&#8217;s generalized so that any frequent updates can be added and broadcast to the rest of the app using a notification pattern.<\/li>\n<li>Added support for push notes via OneSignal, including storing push note data on the server so I can support server-side\u00a0push notes later. (Later meaning tomorrow, when I hope to get them working!)<\/li>\n<li>Added client support for loading band info at startup (future support for multiple apps running on the same server)<\/li>\n<li>Updated top-bar layout to user prettier (and smaller) font<\/li>\n<li>Completely refactored app startup sequence into a service separate from controllers (should have done this in the first place!)<\/li>\n<\/ul>\n<p>Whew! That&#8217;s a lot for one week, but I still had a bunch of other stuff going on (errands,\u00a0etc.) so I definitely could have done more.<\/p>\n<p>Plus, I wasted a ton of time on push note stuff before implementing OneSignal. I didn&#8217;t realize that OneSignal handled the whole PN prompt process from the start!<\/p>\n<p>One thing I want to note that I did last week that I&#8217;m really proud of is lazy loading of user info in chat. Basically, I don&#8217;t want to send player info along with every chat message because that&#8217;s hugely inefficient. Here&#8217;s my solution:<\/p>\n<ol>\n<li>Chats from the last week are sent to the client on startup along with player info.<\/li>\n<li>Leaderboard data is always sent on startup, and it includes the top 250 users. It&#8217;s safe to assume that these will also be users who chat a lot. Player info\u00a0from the leaderboard can be used to populate player info in chat.<\/li>\n<li>Chat info loaded from the &#8216;heartbeat&#8217; (IE after startup) is sent only with player id and message. The client matches up player ids to existing in-memory data, compiles a list of player ids from chat that it doesn&#8217;t have data for, and sends that list back to the server\u00a0to get info for JUST those players.<\/li>\n<\/ol>\n<p>This guarantees that the client will only ever load player data for new chat participants, and the server doesn&#8217;t ever have to send\u00a0redundant player data along with &#8220;heartbeat&#8221; chat data.<\/p>\n<p>Whew, that&#8217;s it for now! Tomorrow I&#8217;ll tackle server-side push notes and then hopefully go see Star Trek Beyond!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I quit my job to build an app and start a startup! It&#8217;s been a few weeks and I&#8217;ve been posting updates to Facebook, but today I feel like updating my WordPress! According to my git commits, here&#8217;s what I did this week: Check-ins are now associated with shows instead of venues (obvious in retrospect) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-60","post","type-post","status-publish","format-standard","hentry","category-startup"],"_links":{"self":[{"href":"http:\/\/www.nemo10.net\/blog\/wp-json\/wp\/v2\/posts\/60","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.nemo10.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.nemo10.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.nemo10.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.nemo10.net\/blog\/wp-json\/wp\/v2\/comments?post=60"}],"version-history":[{"count":2,"href":"http:\/\/www.nemo10.net\/blog\/wp-json\/wp\/v2\/posts\/60\/revisions"}],"predecessor-version":[{"id":62,"href":"http:\/\/www.nemo10.net\/blog\/wp-json\/wp\/v2\/posts\/60\/revisions\/62"}],"wp:attachment":[{"href":"http:\/\/www.nemo10.net\/blog\/wp-json\/wp\/v2\/media?parent=60"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.nemo10.net\/blog\/wp-json\/wp\/v2\/categories?post=60"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.nemo10.net\/blog\/wp-json\/wp\/v2\/tags?post=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}