Skip to content
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

OSX notifications #5

Open
derekantrican opened this issue Aug 4, 2021 · 6 comments
Open

OSX notifications #5

derekantrican opened this issue Aug 4, 2021 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@derekantrican
Copy link

According to the readme, looks like this doesn't support OSX. Adding this issue as a tracking issue for that support

@pr8x pr8x added enhancement New feature or request help wanted Extra attention is needed labels Aug 4, 2021
@TheVeryStarlk
Copy link

Have you thought of using commands? Like this
osascript -e 'display notification "hello world!"'

@cricketthomas
Copy link

i have an intel mac with osx monterey, which i think will be new enough (its out of support now but its on 12.7.1). Do you have any guidance on contributing? I guess all i would need to do is open that xcode proj and update the api?

@pr8x
Copy link
Owner

pr8x commented Nov 27, 2023

@cricketthomas Hey, my initial plan was to just create a slim wrapper around the native UNUserNotificationCenter API and call it via P/Invoke. The main concern would be how to handle the app bundle registration. IIRC in order to send notifications on IOS/OSX your app needs to be registered somehow.

We could check out other projects like Juce or Unreal Engine. They seems to have the local notifications on OSX figured out.

@cricketthomas
Copy link

@cricketthomas Hey, my initial plan was to just create a slim wrapper around the native UNUserNotificationCenter API and call it via P/Invoke. The main concern would be how to handle the app bundle registration. IIRC in order to send notifications on IOS/OSX your app needs to be registered somehow.

We could check out other projects like Juce or Unreal Engine. They seems to have the local notifications on OSX figured out.

Wouldn't registering it just be done in the Entitlements.plist (i am not super familiar either)?
https://docs.avaloniaui.net/docs/distribution-publishing/macos
MAUI has something similar
https://learn.microsoft.com/en-us/dotnet/maui/ios/entitlements?view=net-maui-8.0&tabs=vs

@pr8x
Copy link
Owner

pr8x commented Nov 28, 2023

@cricketthomas Ah I see. I wonder if this could be done from code? Would love this library to be "plug-and-play" without having to go through extra build steps. But if it's unavoidable it's also OK.

@campos02
Copy link

I managed to include local notifications into an Avalonia app I'm working on using the new API. Couldn't get the delegate part to work, so no activation or button press events, but showing them works fine and I'm sure things like scheduling can be coded too.

It's all a couple Objective-C functions which I used P/Invoke to call. As for getting them to work I just had to create an app bundle doing like the documentation says, what's a bummer is you need to sign that bundle, otherwise the OS won't even show the notifications permission banner and will deny them instantly.

Not a complete support but could be useful for this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants