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

*2016-01-29*

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

[![](screen.gif)][AppStore]

I&apos;ve released new version of CI2Go, the [@circleci] client for iOS that supports real-time log watching.

**[CI2Go on the App Store][AppStore]**

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

<!--more-->

## Under The Hood of Real-Time Updating

As I mentioned in [v1.0.0 entry], the app didn&apos;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.

- [pusher.cjs](https://github.com/circleci/frontend/blob/master/src-cljs/frontend/pusher.cljs)
- [frontend](https://github.com/circleci/frontend)

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

```sh
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&apos;t upload Watch OS apps larger than 50 MB.

```
ITMS-90389 Size Limit 50 MB Exceeded
```

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

If you&apos;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.

[AppStore]: https://itunes.apple.com/app/id940028427?mt=8
[API]: https://circleci.com/docs/api
[New Issue]: https://github.com/ngs/ci2go/issues/new
[@circleci]: https://circleci.com
[v1.0.0 entry]: /2014/11/26/ci2go/
[Pusher Authentication Endpoint]: https://pusher.com/docs/authenticating_users#authEndpoint/lang=ios
[pusher-websocket-swift]: https://github.com/pusher-community/pusher-websocket-swift
[pusher-community/pusher-websocket-swift/pull/22]: https://github.com/pusher-community/pusher-websocket-swift/pull/22
[Realm]: https://realm.io
[WatchConnectivity Framework]: https://developer.apple.com/library/watchos/documentation/WatchConnectivity/Reference/WatchConnectivity_framework/


