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

[question]: How to set ios_interruption_level? #48

Open
1 task done
ryansalt opened this issue Mar 23, 2024 · 2 comments
Open
1 task done

[question]: How to set ios_interruption_level? #48

ryansalt opened this issue Mar 23, 2024 · 2 comments

Comments

@ryansalt
Copy link

How can we help?

Hello
I can't seem to find where to set ios Focus levels in the API.

The field would be ios_interruption_level, which I want to set to TimeSenstive, but doesn't appear in the notification properties.

Is it somewhere else?

Code of Conduct

  • I agree to follow this project's Code of Conduct
@geoffhardy01
Copy link

@ryansalt did you ever figure out how to do this?

@geoffhardy01
Copy link

In case it helps anyone, one way I found to get this working was to sub-class Notification and add the property:

public class OneSignalNotification : Notification
{
    public OneSignalNotification(string appId) : base(appId: appId)
    {
    }

    [DataMember(Name = "ios_interruption_level", EmitDefaultValue = true)]
    public string IosInterruptionLevel { get; set; }
}

This can be assigned values such as "active" or "time_sensitive".

Hopefully future versions of this API include a IosInterruptionLevel property so that this is not necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants