Hi
I don´t get push notifications to work consistently. On my Asus Zenphone 9 I don´t get any notifications at all, when testing both from the appfarm showroom example, or my own app. The phone receives notifications from all native apps. My PWA is listed in apps that are allowed to send notifications. (And both apps are “installed”)
I also tested my app on an iPhone and I got notifications once, but then no more notifications came in (I did not “snooze” or anything like that). I have enabled notifications on the phones via the action node before testing and I get a successful “push notification sent” in the console whenever a push shall be sent. It does not seem to work consistently.
Is there any way of troubleshooting this on the phone, or would it be possible to get some logging server side (if it stops there somehow?)
I also miss a more comprehensive documentation on docs.appfarm.io. For instance, when will the notification be delivered - does the browser need to be active (Seems that it works if it runs in the background) and any recommendations on how to make it work on mobile phones that don´t deliver them. Also, how does this TTL actually work. (What is the flow of the push notification - when will it be delivered etc)
If anyone has built push notifications in their app and made it work for “all” users succesfully, I would be grateful for any pointers and typical problems…
First, there are a few steps that are up to the developer or user to make push notifications work.
Read the “Remarks” section in the documentation of Push notifications here
Second, we have a bug in the way this works in Appfarm. Give this scenario: The app is added to home screen (installed PWA) and requests permissions, and the user says “Deny”. Then, the user goes to the notification center on the phone, and allows permissions. With this flow, the “Appfarm server” does not know about the subscription, and will not send notifications to that user/device. Workaround: Uninstall PWA, reinstall, request permissions (and accept). Or if you have the same issue in the browser: Reset permissions, then request permissions.
Thanks
With regards to deliverability of messages to users that are not actively using the app, is there any practical difference between sending the push from the client itself versus sending from a service?
use case;
employee A sends an update for employee B, employee B has not used the app for 4 hours.
option
1 - A sends the update, server pushes the notification to B when receieving the update from A
2 - B´s app has subscribe to updates and receives a notification object, and then sends the push to itself.
I often find that I get the push notifications first when the app is opened up/activated, so it seems the client activity is paused after some time on my mobile.
The target is to get it to work as similar to a native app as possible… if you know any settings or tweaks to keep the PWA process always running that would probably help.
Hi - 2 more questions regarding push and notifications
1.
We are experiencing some problem with the push service. The problem is that after some time, the push messages are no longer coming through, even when the app is running. “Closing” and reopening the app does not seem to help. To get it working again I need to trigger a push notification from the app it self (I made a “send me a push test” action that fires a push notification). When this is done, the notifications start coming again.
So I wonder if you know about this issue and how it can be avoided? My current setup is that a service sends the push message (option 1 above).
the customer would like to get a badge on the installed pwa icon to see “if something is waiting”. As far as I can see this should be supported on android and iOS. Is this possible to achieve now in appfarm or is it something you can consider in the near future?
Is this in Development environment or Production/Test? We have some upcoming improvements (next version) related to handling that the user rejects push notifications, and later wants to allow those notifications (e.g. from the “App settings” menu on the phone).
A new app variable will be introduced in the next version, showing what the user actually has responded to the push notification permission request. That value may be retrieved today with the code/function by checking the value of Notification.permission (it may be “default”, “granted” or “denied”)
The “Request Permission” action node is async today, but it should wait until the user has responded, and then continue (in order to check what the user responded in the next action node). Some improvement will be implemented in the upcoming version.
Already today, you may try to debug by checking that the value of Notification.permission is, and you may show some warning if denied or default, to make sure the user clicks a button to ask for permissions again.
Challenge registered! It was not supported a while back.
The issue is reproducible both in dev and prod. I will try to see if the value notification.permission somehow is denied after a while, even though I have not done anything on the mobile to stop notifications (except not using it in the app for some days)
So im sure that I never rejected the permission dialog, Im leaning towards that could be something in the OS marking it as an inactive app or something like that… Will try to see if I can find the threshold for the number of days of inactivity until it stops working.
It would be very helpful if the service that sends the push could get feedback whether the push was delivered or rejected (or timed out), that way I could detect the users not receiving the push. Now they just don´t get the push so they just think nothing is happening…
Thanks this would be highly appreciated by our users.
Generally I think some more documentation on the whole subject would be good, how hese processes work, differences between android/iPhone, common issues/problems/work arounds and more troubleshooting tips. (also, differences between initiating it locally vs on the server in regards to robustness. The customer is not willing to use SMS (there are tons of notifications) so we are heavily depending on making push notifications work for all users although I know this is not recommended by you).
Hi @Kristian! Could you provide an update on the issue where the “Appfarm server” is unaware of the subscription and, as a result, fails to send notifications to the user/device?
The current workaround, after notifications are set to “Allow” in settings, seems to be to close the application and then trigger the prompt again to the user.
A new App Variable has been introduced, allowing the end user App to display different messages to the user depending on whether the user has not taken any actions regarding notification permissions, or if the user has granted or denied those permissions. That App Variable (called Notification Permission) may also be used to warn the user in the App UI if notification permissions have not been granted.
Read more here in the Usage section of this article (also, links to showroom exists in this article):