Notification addon - cannot open on iphone

Hi,
the notification addon works fine with app-in notifications.
But, when using an iphone , I cannot open the details.
Doubleclick does not work and if I just touch the row for a second to the the context menu, the edit option is not shown.
It works fine in a notebook browser.

And, it would be great, if the view would be editable to align it to the project needs.

KR
Roland

yesterday we tested the notification addon on a real tour using the main app in the office and the tour app via mobile

it turns out that these topics would be needed to make it really usable via mobile:

  • enable to open the details view also when using a mobile (double click does not work)
  • make the list and details view editable to align it to the project needs
  • allow the creation of new notifications via coding (did not check that, might already be possible)

when those topics are implemented, the addon would be a big benefit to send information to the drivers which are working on a tour with their mobiles and also to enable them to simply send back an information to the controller where we then could implement a dashboard where they can handle the feedbacks…

Hello Roland!

  1. Vaadin has an issue about double click in IOS Safari: [grid] double click event not fired on iOS with Safari in Vaadin 23.1.1 · Issue #3372 · vaadin/flow-components · GitHub.
  2. Do you mean the dialog with received notifications?
  3. You can create a notification from the code like this:
@Autowired
protected NotificationManager notificationManager;

@Subscribe
protected void onReady(final ReadyEvent event) {
    notificationManager.createNotification()
            .withSubject("Notification subject")
            .withRecipientUsernames("username1", "admin")
            .toChannelsByNames(InAppNotificationChannel.NAME)
            //.withTypeName("info")// can be used if you register custom notification type
            .withBody("Message body")
            .withContentType(ContentType.PLAIN)
            .send();
}

Hi Roman,

thx for the answer… the coding I can implement.
But regarding the issue with Vaadin,
that does not really help me to know about.

There is a workaround but I cannot implement that,
because I cannot improve the list and detail view for the notification on my own.

So, one solution would be that you implement the workaround
or you enable me to change the notification views…

The best would be,
to see a list view like implemented now,
but instead of double click on an entry to see the details,
an icon ‘show details’ would be great or if you just put the action into the context list…
I could do that on my own, if I have access to the controller and descriptor …

KR
Roland

Yes, I’ve created an issue to improve showing the notification details: Implement additional way of showing notification · Issue #2526 · jmix-framework/jmix · GitHub

As a workaround you can override this dialog and add a context action.

  1. Firslty create new view that overrides received-in-app-notifications-dialog.xml. Use Extend layout of existing screen

    image

  2. In XML add new action to DataGrid:

    <layout>
        <dataGrid id="userInAppNotificationsDataGrid">
            <actions>
                <action id="showNotification" text="Show" type="list_itemTracking"/>
            </actions>
        </dataGrid>
    </layout>
    
  3. In controller add ActionPerformedEvent handler:

    @Subscribe("userInAppNotificationsDataGrid.showNotification")
    public void onUserInAppNotificationsDataGridShowNotification(final ActionPerformedEvent event) {
       Dialog readNotificationDialog = notificationDialogs.createReadNotificationDialog(userInAppNotificationsDataGrid.getSingleSelectedItem());
       readNotificationDialog.addOpenedChangeListener(this::onReadNotificationDialogOpenChange);
       readNotificationDialog.open();
    }
    

Since this View is opened only as dialog the @Route annotation is not necessary and you can remove it:

@Route(value = "test", layout = MainView.class)
1 Like

great… will try it…

it works…
I didn’t know this overwrite view functionality…
thx a lot!