Real-time Log Support w/CI2Go the @circleci Client for iOS

 日本語

I’ve released new version of CI2Go, the @circleci client for iOS that supports real-time log watching.

CI2Go on the App Store

In order to support real-time log watching, I dropped the API Refresh Interval feature from this version.

Under The Hood of Real-Time Updating

As I mentioned in v1.0.0 entry, the app didn’t support watching logs in real-time due to they have no public API to access on-going build logs.

I investigated how they implement real-time log by reading their code hosted in GitHub and finally I could integrate with their real-time WebSocket notifications.

I found their Pusher Authentication Endpoint also supports API Tokens, not only login session.

curl -i "https://circleci.com/auth/pusher?circle-token=${CIRCLE_TOKEN}" \
  --data 'socket_id=123456.87654321&channel_name=private-ngs'
{"auth":"1cf6e0e755e419d2ac9a:..."}

I found a bug with pusher-websocket-swift while implementing this, and that was fixed.

pusher-community/pusher-websocket-swift/pull/22

Offline Support with Realm

From this version, I changed the local database to Realm from CoreData.

Watch OS 2.0

I also rebuilt the Apple Watch app to base on Watch OS 2.0.

But this still have performance issue.

This version uses WatchConnectivity Framework to transfer data from iPhone to reduce application size (almost Realm.framework), because we can’t upload Watch OS apps larger than 50 MB.

ITMS-90389 Size Limit 50 MB Exceeded

But WCSession’s data transfer is quite slow, so I’m working on updating to access the API by itself and will be fixed in next release.

If you’re a heavy Apple Watch user and real-time updating is not so necessary, please omit this update.

Drop me a New Issue if you have any.

comments powered by Disqus