kean / Pulse

Network logger for Apple platforms

Home Page:https://pulselogger.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pulse breaks Watch Connectivity after opening

ptxmac opened this issue · comments

After opening the PulseUI on iOS a LoggerSyncSession is created. This class replaces the WCSession delegate on init, without any regard for an existing delegate.

This will more or less break any iOS app that has a companion Watch app.

A better solution would be to either:

  • Force the user to explicitly check for file transfers and forward any pulse files to LoggerSyncSession
  • Keep the original WCSession delegate and forward all calls unless it's something only Pulse cares about

Good catch. I don't know why it never occurred to me that the delegate was shared 🤦‍♂️

Force the user to explicitly check for file transfers and forward any pulse files to LoggerSyncSession

Can you please elaborate on that?

There is a new ShareLink API in watchOS 9. I wonder if it could replace this feature. It'll also partially cover the lack of remote logging on the physical devices. I originally added WCSession because of the lack of sharing.

Force the user to explicitly check for file transfers and forward any pulse files to LoggerSyncSession

Can you please elaborate on that?

Meaning the developer integrating Pulse is responsible for implementing a WCSession delegate and check if a file transfer is happening.

Ah, got it. Yeah, that makes the most sense. But I'm not sure if it's worth keeping this feature given that the ShareLink now exists. Yes, it's going to require slightly more steps, but it'll work on any platform.

Btw, in addition to Pulse for Mac, there is also a new Pulse app coming for iOS. It'll allow you opening Pulse log files on the iOS devices. I haven't pushed it to TestFlight yet.

Yeah, ShareLink does sound like a fair solution, except that It's WatchOS 9 only...
Personally, I always support at least one version back. From my statistics, I still have 6% of users on WatchOS 7!

I've done a couple of (successful) prototypes, and I'm planning to:

  • Remove WCSession activation code from the framework
  • Add metadata to WCSessionFile and ask the user to send it to LoggerStore manually in case it's from Pulse
  • Bring the existing ShareView from iOS to watchOS and use ShareLink internally

This will not be too much work from the user's point of view and will address the issues you highlighted. Once again, thank you for testing it and reporting the detailed issues. I really appreciate it!