Archive for April 20, 2017

Thursday, April 20, 2017

LivePhotosKit JavaScript API

Apple (via Juli Clover, Hacker News):

By including the LivePhotosKit JS script on your page, you can create players by simply adding declarative markup to your HTML. As the page loads, LivePhotosKit JS will determine what player instances are on the page and initialize them. You can use any HTML tag that supports child nodes.

At minimum, each tag requires the following data attribute: data-live-photo. Doing this allows LivePhotosKit JS to find the DOM elements to be initialized as players.

Then you can specify the locations of the photo and video components by setting the data-photo-src and data-video-src attributes, respectively.

I haven’t been using Live Photos because of the problems they cause with Lightroom.

Facebook Instant Articles and Apple News

Casey Newton (via John Gruber):

In practice, Instant Articles typically do reach more people, because people are more likely to read and share them. But as the format spread, competition increased, and any advantage to using Instant Articles was blunted within months. Given that Instant Articles were designed to carry less advertising than mobile web articles, broad reach was essential to ensure publishers would profit from the format. The reach just never arrived.


In a presentation at the Social Media Week conference in February, The Verge’s audience engagement editor, Helen Havlak, presented a slide comparing views of traditional Verge links posted to Facebook to Verge Instant Articles as a percentage of overall Facebook traffic. It showed that article views from Facebook were essentially flat in 2016, with Instant Articles representing a larger share of that traffic over time. Viewed in this light, Instant Articles had simply replaced one kind of view with another, less profitable one.


Simo says that the News Feed is becoming more of a multimedia experience over time, and that Instant Articles — which support video — is part of that. […] And so for publishers that do their journalism primarily by linking to text, the News Feed appears increasingly forbidding.

Lucia Moses:

If publishers are down on Facebook Instant Articles, they’re increasingly effusive about Apple News as a platform partner.

Apple News, a pre-installed app on Apple phones and tablets, has long been the distant No. 3 in platform publishing initiatives. Introduced in 2015, Apple News didn’t elicit the kind of excitement Facebook got with IA and Google with its Accelerated Mobile Pages. But in recent months, Apple began sending more traffic publishers’ way and letting them sell subscriptions on the news aggregation app. Kunal Gupta, CEO of branded content platform Polar, which works with premium publishers, estimates that for those publishers that are benefiting big, Apple News is supplying 10-15 percent of their mobile traffic.

Update (2017-04-27): Jessica Davies:

Publishers aren’t happy with the deal platforms are cutting them. Now, the Guardian has dropped both Facebook’s fast-loading Instant Article format and will no longer publish content on Apple News.


Meanwhile the Guardian’s use of Google’s Accelerated Mobile Pages, the rival to Instant Articles, seems to be going strong. In March the Guardian presented at AMP Conf, a two-day conference hosted in New York, where it revealed that 60 percent of the Guardian’s Google-referred mobile traffic was coming via AMP.

Via John Gruber:

Follow that link, though, and it doesn’t sound like The Guardian is getting much out of AMP[…]

Bose Headphones Spy on Listeners

Jonathan Stempel (Hacker News, MacRumors):

Bose Corp spies on its wireless headphone customers by using an app that tracks the music, podcasts and other audio they listen to, and violates their privacy rights by selling the information without permission, a lawsuit charged.

The complaint filed on Tuesday by Kyle Zak in federal court in Chicago seeks an injunction to stop Bose’s “wholesale disregard” for the privacy of customers who download its free Bose Connect app from Apple Inc or Google Play stores to their smartphones.

Nick Heer:

I downloaded the Bose Connect app and read its privacy policy and terms and conditions. While both explain that the app uses analytics software, nowhere in either document does it say that it will transmit listening habits.


I downloaded the app on android and listened to a few songs on Spotify to find out what information was being sent.

While the app is running, the app sends a HTTPS request every time the track information changes or the volume changes. When the track information changes it sends the artist, album and song name. When you change the volume it sends the new volume level.

Every request includes standard meta-data such as

  • An _anonymous-id_
  • Device serial number
  • Information about whether wifi or cellular are connected and carrier name
  • Device name, model and manufacturer


For those that missed it, a representative from one of the other companies named in the suit helpfully dropped in to provide additional context on their company’s part in this. It even had a super positive “happy to answer … questions” attitude. It was deleted in a few minutes as they realized how poorly that was going to turn out.


In this particular case, people are upset because the hardware is not completely functional without the app - so people can’t just not use it or “opt out” without losing part of what they just paid a fair amount of money for. No one would use the app except for that functionality, so collecting information on “app use” when the use of the app is a manufactured scenario seems quite unfair for a high-end product.

The app is here.

Naming Swift Extensions

David Owens II:

There’s a lot of talk about how extensions are used for code organization. This is even one of the primary defenses for some of the Swift proposals. However, it’s missing a key component of organization: categorization.

If you remember when dinosaurs roamed the Earth, they wrote code to maneuver their space ships with a language that must have been from aliens: Objective-C.

If you wanted to extend a type and provide yourself some new goodies, you would do so like this:

@implementation Raptor (BirdOfPrey)
// new cool stuff here

In Swift, however, it’s not as clear what we should do.

There are several different options, none of them ideal. With Objective-C, you would actually see @implementation Raptor (BirdOfPrey) in the Document Items pop-up menu in Xcode. As far as I can tell, there’s no way to get the Swift type name and category name into a single menu item like that. I have been using:

extension Raptor { // MARK: BirdOfPrey
    // new cool stuff here

To me, this adds the least noise while also making the category name stand out a bit in the source. BirdOfPrey will also show up in the menu, indented under Raptor.

Previously: Swift Type Aliases.