I just started developing in the Playdate SDK. I Find it very cool so far, but the only feature I am disappointed at not having is HTTP requests.
I am planning on making a weather app and a social media client. I know that you can use playdate.simulator.getURL(url) in the simulator, but I would like more functionality.
Here are some example of requests:
It's definitely something we'd like to do, but we need to figure out the best way to do it while balancing performance, security, battery life, and other concerns. Wish I had a better answer!
I'd be interested in being able to make HTTP requests as well.
In the absence of that... is there ANY networking functionality in Playdate SDK that I can get to? Like, can I create and connect a TCP socket (ok, some TLS would be great also; ) in C or Lua (or Rust?; )?
Have you considered implementing a gopher protocol client instead of HTTP requests? Since gopher is far more limited it eliminates a lot of security concerns. Plus it fits in with the Playdate's quirky nature in my opinion. Even one of Panic's founders embraces the gopher protocol!
security concerns. for example, a game could record you and upload it to a remote server without your consent or knowledge. they're also trying to balance out battery life issues with it, but it's been over a year since I asked so I have no idea where they are on working on it.
For me at least, it would be totally fine to have local network access (or maybe a HTTP server) for my own in-dev stuff. It certainly would be fun to build a game that uses a database of parameters I could live reload over the network as I'm developing it.
+1 on limited HTTP access. Honestly, my wishlist for the playdate would have been "shoulder" buttons (for rotations / tabbing when making puzzle/mystery games) and very limited WiFi access for puzzle downloads and making utility/knowledgebase style apps. I think Vivi's request for a synched KV store I can manage from elsewhere without fully recompiling + reuploading the app is exactly one I share, just not only for development, and is all I think most people in this thread are after if I'm reading right.
For the latter I think most security concerns could be alleviated with narrow verb, rate limiting, payload size and type, and protocol support (GET/POST and 10KB table[str, str] only, for example), either a manifest file whitelisting a single URL (others can be inferred via a protocol, below) or a Panic-hosted service, and a user notice at app launch and at network request (similar to content warnings currently) - so effectively anything more than simple database access is at the very least highly impractical.
I don't share many of the concerns in this thread:
Whilst these preventions (short of panic hosting) won't stop e.g. ads/spam/datahoarding via sideloading, Panic can set policies on Catalog (or the hosted service) to prevent ads via that "preferred" channel.
Shovelware already exists on itch, so I don't think adware wouldn't be a distinct issue.
Power draw / poor performance wouldn't be a factor worse than UX if there's a system popup each time, allowing the user to opt out of a poor experience.
There's not going to be much information in PDX containment for privacy to be a massive concern
tldr; wishlist
Panic-hosted KV store (similar to Scoreboards) for general access (with reasonable limitations and a system popup to prevent spamming);
Or minimal support for online KV sync, e.g.
GET {pdxinfo.KV_HOST_URL}/{key_prefix}/_
Accept: x-www-form-urlencoded
Purpose: to allow namespacing via dot notation or other, e.g. in the form 'puzzles.{creator_id}.{puzzle_id}' or 'preferences.{device_id}.{preference_id}'
GET {pdxinfo.KV_HOST_URL}/{key} Accept: x-www-form-urlencoded (content length < 256)
(I actually think this may be a bad idea for caching / request spam)
POST {pdxinfo.KV_HOST_URL}/
Content-Type: x-www-form-urlencoded
Content-Length: <256
SDK helpers for above, and a device identifier for use in keys:
pd.networking.kv.get_from_prefix(prefix: str): table[key: str, value: str] raises pd.networking.kv.get(key: str): str raises
pd.networking.kv.set(values: table[key: str, value: str]): void raises
pd.networking.deviceId(): str