Skip to content

feat: implement notification proxy #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Aug 14, 2025

Conversation

Delta456
Copy link
Contributor

@Delta456 Delta456 commented Aug 8, 2025

This PR implements the NotificationProxy service, which is used to listen to and broadcast notifications. It uses the Shim Remote RSD service.

Closes #56

A basic example using observe and receive the notification one time

await notificationProxyService.observe('com.apple.springboard.lockstate');
    const gen = notificationProxyService.receiveNotification();
    const { value: notification, done } = await gen.next();
    if (done || !notification) {
      throw new Error('No notification received.');
    }
    console.log('Received notification:', notification);

Looping all observed notifications

 await notificationProxyService.observe('com.apple.springboard.lockstate');
    const gen = notificationProxyService.receiveNotification();
    const { value: notification, done } = await gen.next();
    if (done || !notification) {
      throw new Error('No notification received.');
    }
    for await (const msg of gen) {
      console.log('Received notification:', msg);
    } // Keep the generator running to receive more notifications

Observe and post notifications

 const notificationName = 'com.apple.springboard.lockstate';
    await notificationProxyService.observe(notificationName);
    const gen = notificationProxyService.receiveNotification();
    const { value: notification, done: done } = await gen.next();
    if (done || !notification) {
      throw new Error('No notification received.');
    }
    const post = await notificationProxyService.post(notificationName);
    console.log('Received post notification:', post);

@Delta456 Delta456 requested a review from saikrishna321 August 8, 2025 12:54
@Delta456
Copy link
Contributor Author

@mykola-mokhnach I have done changes as requested.

@saikrishna321 saikrishna321 merged commit aede9f5 into appium:main Aug 14, 2025
11 checks passed
github-actions bot pushed a commit that referenced this pull request Aug 14, 2025
## [0.2.0](v0.1.1...v0.2.0) (2025-08-14)

### Features

* implement notification proxy ([#59](#59)) ([aede9f5](aede9f5))
Copy link

🎉 This PR is included in version 0.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Delta456 Delta456 deleted the notification_proxy branch August 14, 2025 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

implement notification proxy
5 participants