Enable "Require Interaction" feature

Hi, Guys!

I have a question how can we allow users to interact with notification in order to remove it from their computer screen.

By default notifications simply disappear.

 

Is there way we can enable Require Interaction option via Java API ?

https://docs.urbanairship.com/guides/optional-delivery-features/#require-interaction


 

Thanks,

Anastasiya

Didn't find what you were looking for?

New post

Comments

8 comments

  • Hi Anastasiya

    Yes, using the WebDevicePayload.Builder in the 3.0.0 Java Library you can create a Web Notify specific section of the payload and you can use the addExtraEntry method to add the require_interacation key.

    Comment actions Permalink
    0
  • Hi Aidan!

    Thank you for suggestion.

    But looks like it doesn't work:

    WebDevicePayload webPayload = WebDevicePayload.newBuilder()
    .setAlert("Alert")
    .setTitle("Yikes, did you catch it?").addExtraEntry("require_interaction", "true")
    .setWebIcon(WebIcon.newBuilder().setUrl("https://www.example.com/test.jpg").build())
    .build();

    Am I correct?

    Could you please provide example?

    Anastasiya

    Comment actions Permalink
    0
  • Hi Anastasiya, 

    What was the problem with your test?

    Comment actions Permalink
    0
  • Notifications disappear after some time (~10 sec).

    addExtraEntry("require_interaction", "true") was added but option does not work.

    Comment actions Permalink
    0
  • Guys, any updates?

     

    Today we tried to push manually two types of messages to compare its behavior.

    Test:

    For both cases PC is locked.

    1) Option is disabled:

    Chrome notification appears when I start to unlock PC.

    2) Option is enabled:

    Chrome notification appears only in Notification center after PC is unlocked.

    No differences for FF.

    Could you please explain require_interaction option meaning?

    According to documentation:

    Require Interaction

    Users may interact with a web notification in these ways:

    • Click the notification, which opens the message-defined URL, or the default Action URL.
    • Dismiss the notification.
    • Click the Settings icon or button on the notification.

     

    But its option works not as expected

    Thanks,

    Anastasia

    Comment actions Permalink
    0
  • Hi Anastasia,

    You should get a Push ID returned when you send a message to us, could you pass me that so I can take look at it. 

    Thanks. 

    Comment actions Permalink
    0
  • Hi Anastasia,

    Does it work as expected if you send a normal HTTP or cURL API call?

    Comment actions Permalink
    0
  • To enable the "Require Interaction" feature, just tweak the notification settings in your code so they stay active until the user interacts. I did something similar while fixing a computer repairs system to make sure users didn’t miss important alerts!

    Comment actions Permalink
    0

Please sign in to leave a comment.