Free Developer Christmas Gifts

December 22nd, 2017

Yes, the footer displaying the current mouse-over link in the beta is back.

Brent Simmons, a developer I have never met, has sent me a christmas gift. As those of you in the beta know, the web view that displays the details for an item is all brand new in the latest version and based on WKWebView. One of the features that got lost in the beta was the mouse-over link being shown in the footer bar.

The method for showing this information is there in WKWebView but is marked with the dreaded underscore prefix, which means it’s for Apple use only. I left it as a todo a few weeks back, I figured that with some JavaScript I could get a call back when mouse entered a link, but did not want to switch from programming in Objective-C to JavaScript at that exact moment.

Luckily for me Brent ran into the same issue and his project being open source and MIT license meant it saved me a lot time. I was able to piggy back off his code, without having to write any JavaScript, simply using his.

For those looking for an Objective-C version here is mine. I have templates being loaded from many places including user generated ones. So instead of embedding the JavaScript in the file, I inject it with the same WKWebView userContentController that handles the call back.

First the Javascript, pretty much the same as Brent’s.

/* From Brent Simmons https://github.com/brentsimmons/Evergreen/blob/master/Evergreen/MainWindow/Detail/ArticleRenderer.swift */

function startup() {
    var anchors = document.getElementsByTagName("a");
    for (var i = 0; i < anchors.length; i++) {
        anchors[i].addEventListener("mouseenter", function() { mouseDidEnterLink(this) });
        anchors[i].addEventListener("mouseleave", function() { mouseDidExitLink(this) });
    }
}
function mouseDidEnterLink(anchor) {
    window.webkit.messageHandlers.mouseDidEnter.postMessage(anchor.href);
}
function mouseDidExitLink(anchor) {
    window.webkit.messageHandlers.mouseDidExit.postMessage(anchor.href);
}

/* Gets loaded by the WKWebView addScript: */
startup();

Then the code to receive the call back in Objective-C when the mouse enters and exist any link.

#define MOUSE_DID_ENTER @"mouseDidEnter"
#define MOUSE_DID_EXIT @"mouseDidExit"

- (void)MyInit {
    [self.configuration.userContentController addScriptMessageHandler:self name:MOUSE_DID_ENTER];
    [self.configuration.userContentController addScriptMessageHandler:self name:MOUSE_DID_EXIT];

    NSString *webViewFiles = [[[NSBundle mainBundle] pathForResource:@"InfoTemplates" ofType:nil] retain];
    NSString *pathToJavaScript = [NSString stringWithFormat:@"%@/includes/bruji.js", webViewFiles];
    NSString *javaScript = [[NSString alloc] initWithContentsOfFile:pathToJavaScript encoding:NSUTF8StringEncoding error:NULL];
    WKUserScript *script = [[WKUserScript alloc] initWithSource:javaScript injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
    [self.configuration.userContentController addUserScript:script];
}

#pragma mark - WKScriptMessageHandler
- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
    if ([message.name isEqualToString:MOUSE_DID_ENTER]) {
        NSString *link = message.body;
        if ([link isKindOfClass:[NSString class]]) {
            [self setFooterLink:link];
        }
    }
    else if ([message.name isEqualToString:MOUSE_DID_EXIT]) {
        [controller setNumberOfSelectedInFooter];
    }
}

Now included in the latest beta for those that mourned the lost functionality.

On a related note, I can’t wait for further improvements on Brent’s latest newsreader project: Evergreen. I’ve been using version 3.1 of NetNewsWire for ages now, as the new versions were never as great as the original. Sadly feeds are starting to go dead, I think due to some type of HTTPS compatibility.

With this christmas gift we are getting closer to that inevitable 6.0 release. But first it’s time to take a little break. Happy holidays everyone!

Happy Pedia Giving: Beta for Sierra and High Sierra

November 23rd, 2017

The first beta (5.9) for what will then be version 6.0 is here. We will be rolling out changes slowly throughout the beta to better isolate where bugs still need fixing. The most important thing to know about this beta is that it only supports Sierra 10.12 and High Sierra 10.13 MacOS. If you have an older MacOS, the old version 5.7 will still be available for download, but will only get security fixes if necessary.

This first beta is mainly about changes for the details view, including fixes for those experincing issues with the links in High Sierra turning the program unresponsive.

 




Even if you are already running a beta, you must manually download one of the betas above, being the beginning of a 10.12 version only. Please jump on board the beta train if you wish to help out getting the next version ready. The beta programs will self update as we go along. If you run into any issues don’t hesitate to send me an email, so that we can roll the fixes into the next beta.

For those of you in America, Happy Thanksgiving! Let some beta tryouts be the best way to digest that turkey.

MacOS High Sierra

November 1st, 2017

Sierra

All the Pedias have been updated to version 5.6. Although we had rolled most of the MacOS High Sierra changes into 5.5.2, there are a few tiny fixes that trickled in as more users moved to High Sierra. There are still a few rough edges, for example in the web view when browsing links, that will be fixed in a future version. Which brings us to the announcement that this version or one close to it will be the last version to support MacOS 10.5 (Leopard).

The era of the big cats is dead and with it soon support for those older systems in the future Pedias. We have been working on a parallel version that will only support 10.12+ and above. This is why some of the rough edges exist in High Sierra with 5.6, as we need to drop older system support to modernize the web view and bring all the new enhancements to the new version.

In short if you are on an older MacOS, be sure to grab this version to stay with the latest version that will run on your system. Soon the open beta will move to the 10.12 only version and that will be announced here, for those that want to test the new version early.

As usual the self update should take care of updating for you, either our own or the Mac App Store. Otherwise click the links below and replace your current version:

Bookpedia
CDpedia
DVDpedia
Gamepedia

Pocketpedia 3.4.4: The Move Edition

January 24th, 2017

Version 3.4.4 brings the ability to select covers while editing from your own media library. So that you can select those images that you took a quick snap of while at the shop. Also has the ability with tap and hold to use copy paste, if you are bringing in an image from a website without having to save it into your own media library.

Pocketpedia Swipe Gesture

A common feedback is that the move button is buried in the footer of the edit screen. Which means tapping edit, scrolling down and then using the move button, when doing several items this quickly becomes tedious. The move is now available directly from the swipe options, instead of just delete. Also the ability to mark something as played, seen or read. Should an entry currently be borrowed the read button will become return, giving another quick access to a common action.

5.5.1 Pedias, The macOS Sierra Version

November 6th, 2016

Version 5.5.1 is now live and ready for download.

macOS Sierra

This is mainly full of smaller fixes for macOS Sierra that were hard to catch before the final release of the Sierra gold master. We ran the Sierra betas and added any fixes into version 5.5 and released this before Sierra so that users would not even notice any issues when the the Sierra release came.

But bugs are always lurking around corners and a few drawing issues and edge cases made it through the cracks or were introduced in 10.12.1. All that is now fixed in this release.

As usual the self update should take care of updating for you, either our own or the Mac App Store. Otherwise click the links below and replace your current version:

Bookpedia
CDpedia
DVDpedia
Gamepedia

Thank you to the all the beta testers and all the users that wrote in reporting Sierra bugs. We consider 5.5.1 our 100% Sierra version, but if you do run into any issues do be sure to write in and will get it fixed.

Pocketpedia Links and iOS 9

September 16th, 2015

In iOS 9 Apple has made opening links from Pocketpedia slightly better but also slightly worse. The good news is that linking to another app now displays a small text button on the top left hand corner of your screen that lets you quickly back track to Pocketpedia without having to go through the home screen or use a multi-touch gesture. So digging deeper into an HTML, IMDb or PDF link from Pocketpedia is faster and more natural and has a quick return.

Peter iPhone Search

Peter iPhone Search

The bad news is Twitter was abusing the ability to open links with other apps to detect what apps were installed on your device and then targeting advertisement based on this information. Apparently the list of apps checked was as big as 2,500 different apps.

Apple makes a fuss about the need to approve and control the App Store to prevent malicious behavior, yet they didn’t simply ban the Twitter app, instead they put the burden on all the other developers. We are now required to list within our app all possible link types that you might want to open.

This new information goes inside the apps info.plist file under the key LSApplicationQueriesSchemes. Luckily there is no restriction on the number of links that can be listed so far. Pocketpedia for iOS 9 has included a smallish list of the most common types that our users use, such as pdf://, epub://, iBooks:// and imdb://. The problem is that our users are a varied bunch and use all kinds of apps. So if you find that a link to your favorite app from Pocketpedia is no longer listed, please drop us a note with the URL scheme to the name of the app and we will be sure to include it in the next release.

A single person using a single app means we have to list that URL scheme in Pocketpedia for all users. If only a small percentage of users are using a unique app, soon our exception list will grow quite large. But as I said, for now there are no limits and hopefully Apple reviewers will not start complaining that we are listing too many URL schemes.

Apps not updated for iOS 9 have a little leeway of being able to ask for 50 random URL schemes. We petitioned Apple to make this the default via an Apple bug report, but it never came to fruition. Each individual user is likely to only use a few favorite apps from Pocketpedia so a lower limit such as 20 random links would have been a perfect solution and it would have solved the abuse issue from Twitter without any code changes required for other third party developers.

Out of Africa

I find it discouraging that an iOS 8 app gets better support and treatment than an app developed for iOS 9. Especially since the technology exists and is implemented to allow a small number of URLs and could have worked beautifully paired with the new exception list. But on the upside, we now get full Spotlight integration, so you can search your media directly in Spotlight.

Welcome to the Media Search Party Spotlight in iOS 9

September 16th, 2015

You have always been able to search your movies, books, albums and games inside Pocketpedia with the integrated search field at the top of the collection view. Now you can also initiate searches directly from the Spotlight search in your dashboard thanks to third-party Spotlight integration in iOS 9.

The Spotlight search will not only list all the matches across multiple apps but also across multiple media inside Pocketpedia. Spotlight even knows the last item you were viewing in Pocketpedia, giving it more relevance in the search results.

Robert Redford

Apple wants to limit the amount of data that it is forced to index so only the main fields are listed with Spotlight. When you need a deep search (for example searching the awards field) you will have to perform that search in Pocketpedia’s regular search bar directly.

Peter iPhone Search

Peter iPhone Search

Searching directly in Spotlight will list a number of results from different sources and three results from an installed app. There is a small “Show more” button that will expand the Pocketpedia results to include all the matches in your media.

Clicking on the results will take you straight into Pocketpedia’s details view. Linking inside Pocketpedia has also been improved so that you can now easily get back to Pocketpedia after opening a link, using the button at the top left of your screen. Moving between apps now feels natural. (Unfortunately links have also become a bit more limited.)

Peter iPhone Search

Peter iPhone Search

Siri does not yet integrate with the third party index so you can’t ask your phone, “Search for The Princess Bride in Pocketpedia” or even more convenient “Do I have The Princess Bride in Pocketpedia?”. Looking forward to this improvement in iOS 10. It would cement iOS as your one and only private assistant.

Pocketpedia 3.3.3: Sorting Sections

July 3rd, 2015

The latest Pocketpedia version, 3.3.3, is now live in the App Store. Among a few bug fixes the biggest change are new section headers for the current sorting selection. These allow you to see what group of the current sort an entry belongs to right away without having to tap deeper into the details. For example the genre sorting on any of the Pedias.

genre

Useful in several other fields as well that will be enabled for the new sorting, such as rated.

Rated

Although director/author/artist/platform are visible in the item listing view we still included the section headers as it helps to group all the items visually together. The section headers are simple so that the effect is not too distracting.

Author

Hope you enjoy the new version and let us know what you think!

Pocketpedia 3.3: The iPhone 6 Version

April 24th, 2015

Collections in Pocketpedia iPhone 6

Books in Pocketpedia iPhone 6

 

The latest version of Pocketpedia is out and includes support for iPhone 6 and iPhone Plus.

We apologize for the delay in getting this update out there for users sporting the new iPhone sizes. It took us only a month to get the iPhone 6 sizes ready and tuned up, but then we also wanted to add a few extra features that we had been working on. Specifically swiping between details and covers views without having to go back to the list view. We ended up having technical issues with the animation but because we felt close to a break through kept delaying the release.

But now we have gone ahead and released the iPhone 6 update and held the swiping and other updates so that we can work on them some more.

Hope you enjoy all the extra space on the new iPhones as well as not having to look at slightly blurry icons that where being upscaled to fit all the real estate on the iPhone Plus.

Update: 3.3.1 is out with a quick fix for a crashing bug on the iPad. Apple granted us an expedited review, so no wait on the review queue.

Discogs’ API Developers

March 25th, 2015

Although the internet is overflowing with deep data most of it is trapped in old APIs that make working with the data complicated. Wikipedia, one of the largest repositories of contributed information in several languages, still relies on an old MediaWiki API that is almost useless at any meaningful search. Sites have sprung up to try to deal with these shortcoming such as DBPedia that tries to wrangle all this information into a standard meaningful API. But how great would it be instead if Wikipedia developers actually created and maintained a powerful API. It would mean giant leaps to the integration and usefulness of Wikipedia. All of the sudden any app would be able to take advantage of all the crowd sourcing done in Wikipedia in a reliable way.

As much as I wish the above for Wikipedia, this blog post is about the developers who have done just that. The Discogs developers have been constantly maintaining their API. Although they had gone down a path I did not approve of recently with adding limits to the number of images that could be downloaded per account as well as requiring OAuth verification, that was complex and cumbersome to implement. They are now fixing those issues while maintaing backwards compatibility. So the good news is that our search plugin for Discogs will continue to work without update. We have already used the Google OAuth framework to implement authentication with our own private account, to make it as easy as possible for users. But new developers wishing to integrate Discogs will have a much easier time using a simple key/secret pair. The 1000 image limit has also been removed and the signed URL provided directly in the downloaded information. This is the kind of simplicity one wishes in all APIs.

I mention Discogs by name only because they are the latest site in adding simple new features to make accessing their data by their users easier. But the truth is many developers have been doing an extraordinary job sharing their data via an API. The TMDB API always comes to the top when I am asked about good API designs, it has been easy to work with and 100% reliable for DVDpedia. The TV Rage and TheTVDB are more complex APIs but work well all the same. In the music world MusicBrainz has been solid. MovieMeter has been moving backwards in features since maintaining the original API required a lot of work for a single developer. BoardGameGeek has an API that is embedded into their system that works but could do with some 2015 technology improvements. But speaking of improvements the API that could really do with some love is the Library of Congress. Although now using a new SRU standard, it’s still based on a system that is decades old. But it seems updating the way libraries share their catalog is a gigantic undertaking. The above list is not extensive as there are many other search sites with APIs that we are thankful exist: OFDB, Open Library, Google Books, Freebase (Bought by Google), Amazon AWS and AbeBooks.

We look forward to a world where standards improve, for example JSON format has been marvelous at making integrating APIs easy and consistent. Some day information on the internet will be truly available to our future computer program overlords that will do all the communicating for us and present the information we want on command. Hopefully they will be able to even update themselves as data improves. In the meantime we hope developers continue the hard work of maintaining all these endpoints and adding more where needed.