Skip to content

Conversation

@cyberneel
Copy link

This PR Adds support for the Apple Notification Center Service (ANCS). It shows the Title and Subtitles as "Title - Subtitle" and the message is shown in the body of the InfiniTime notification. Accepting and Declining calls also worked.

The only "issue" right now is that you have to ReConnect after the first pair for ANCS discovery to go well. Maybe there is a way in the NimBLE stack to trigger ANCS Discovery after pairing change? Also, sometimes ANCS goes dormant and then works again. I think this could either be iOS throttling or

"ANCS is not guaranteed to always be present. As a result, the NC should look for and subscribe to the Service Changed characteristic of the GATT service in order to monitor for the potential publishing and unpublishing of the ANCS at any time."

@github-actions
Copy link

github-actions bot commented Jan 3, 2025

Build size and comparison to main:

Section Size Difference
text 391308B 8528B
data 944B 0B
bss 22752B 120B

Run in InfiniEmu

@liamcharger
Copy link
Contributor

liamcharger commented Jan 3, 2025

For reference, closes #910

Instructions: since an encrypted connection is required before ANCS is available, you’ll need to disconnect your watch from your companion app after updating, then reconnect. You’ll get a passkey on your watch to enter into the dialog on your iPhone. After bonding, toggle off and on your iPhone’s Bluetooth, then tap InfiniTime in the list of bonded devices. Finally, you’ll get an alert asking you to allow your watch to read notifications. Click allow, and now you should start receiving notifications!

Something to note: as of now, since using ANCS creates a connection through iOS directly instead of through the companion app, the app will not be able to reconnect to InfiniTime without removing the bond, which results in ANCS being disabled until the steps above are repeated. We’re working on fixing this ;)

Update: this is fixed in the latest InfiniLink commit on the rebuild branch

NegativeAction = (1 << 4)
};

struct AncsNotitfication {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@liamcharger
Copy link
Contributor

liamcharger commented Nov 5, 2025

Sigh, meant to merge instead of rebase

Never again will I use the github.com buttons

@liamcharger
Copy link
Contributor

@Crefix notifications are still sent multiple times in some cases and the simulator build needs to be fixed

@cyberneel
Copy link
Author

@liamcharger is this with the PR that @tituscmd proposed?

@cyberneel
Copy link
Author

Also, I had a fix for the simulator build locally somewhere. But I do remember it being a simple fix.

@liamcharger
Copy link
Contributor

@liamcharger is this with the PR that @tituscmd proposed?

No, just updated from main. You can just merge that PR in your fork

Also, I had a fix for the simulator build locally somewhere. But I do remember it being a simple fix.

Yep, just one or two lines, iirc

@tituscmd
Copy link
Contributor

tituscmd commented Nov 5, 2025

@liamcharger is this with the PR that @tituscmd proposed?

While on topic, sorry for not getting to that better solution we talked about in that PR yet. It's exam season so I tend to be quite busy with school. I think for now the PR is fine as it stands since it doesn't make the watch crash anymore. If that PR makes this one more likely to be merged, I think we can bother with an even better solution later. How does that sound to you?

@minacode
Copy link
Contributor

minacode commented Nov 5, 2025

Getting this forward sounds good. Let's improve it in the next iteration if it is still functional.

tituscmd and others added 2 commits November 8, 2025 20:04
Fix race condition in ANCS discovery by adding MaybeFinishDiscovery helper

NOTE: Going to merge this for now, and I will then add the functionality I talk about [here](#19 (review))
@cyberneel
Copy link
Author

I merged the PR @tituscmd made that reduces crashes.

I am trying to figure out what causes the multiple notifications glitch and and soo if the cahcing I suggested here is really needed.

I haven't come into any instances where notifications don't show up yet.

@tituscmd
Copy link
Contributor

tituscmd commented Nov 8, 2025

I haven't come into any instances where notifications don't show up yet.

If by this you mean notifications appear on the phone but not on the watch, I have indeed had this happen

@cyberneel
Copy link
Author

I haven't come into any instances where notifications don't show up yet.

If by this you mean notifications appear on the phone but not on the watch, I have indeed had this happen

I see, I am trying to figure out behavior. Could you maybe note symptoms of when these 2 glitches happen next time?

@tituscmd
Copy link
Contributor

tituscmd commented Nov 8, 2025

I see, I am trying to figure out behavior. Could you maybe note symptoms of when these 2 glitches happen next time?

It's very difficult, if at all possible, to figure out a cause. I have yet to find any correlation at all...

@minacode
Copy link
Contributor

minacode commented Nov 9, 2025

@cyberneel, can you gather a checkbox-list of all current issues in the main description?

@tituscmd
Copy link
Contributor

tituscmd commented Dec 5, 2025

About these little glitches that happen with ANCS, I think the thing where one ANCS notification appears on the watch multiple times happens when that notification is summarized by Apple Intelligence. This seems like a correlation I've made over the last few weeks/months, though I can't say that's exclusively it.

@liamcharger
Copy link
Contributor

@mark9064 can we get a workflow approval?

Trying to test something out, but I can't get an environment set up for compiling right now ;)

@mark9064
Copy link
Member

Triggered :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature This thread is about a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants