Push and Local Notifications

Within the 1C: Enterprise platform and within the cellular forum, we’ve carried out a mechanism for push notifications and native notifications.

Push and native notifications are primarily an approach to inform the person about an occasion. Furthermore, this occasion can happen even in the meanwhile when the cellular software is within the background (launched, however inactive) or when it’s merely unloaded from reminiscence and isn’t executed.

Native notifications

Native notifications are helpful software for implementing many reminders that the cellular app units for itself. Reminders, which can be triggered on the very second when the applying, will not be lively.

Creating a neighbourhood notification in a cellular app would possibly seem like this:

And the processing of a neighbourhood notification in cellular software would possibly seem like this:

Native notifications will be prompt (displayed instantly), scheduled (shown at a specified time), or periodic (displayed once more after a specified interval).

Push notifications

Utilizing push notifications, you may implement situations of the interplay between the primary and cellular functions on the initiative of the direct software. When an occasion happens in the primary software, the applying sends push notifications to recipients – cellular processes.

Additional, two situations of interplay are doable. First, the data related to the occasion will be handed within the push notification itself; however, keep in mind that its dimension is restricted.

Due to this fact, if you’ll want to switch a large quantity of knowledge, you need to use a distinct communication state of affairs. It makes use of a push notification solely as a sign to the cellular software that it must contact the primary software. Having obtained a push notification, the cellular software independently communicates with the direct software in the best way it often does, such as an online or HTTP service. And it receives the info that the primary software has ready for it.

To switch notifications from sender to receiver, the push notification mechanism uses a third-party part – a notification supply service. We have now carried out help for 2 such providers:

Because of this, the overall scheme of interplay appears to be like like this:

  • Sender – the primary software of 1C: Enterprise;
  • Notification supply service (APNs or GCM) – sends a notification to a cellular machine when it turns accessible on the Web;
  • Recipient – 1C: Enterprise cellular software.

For instance, sending a push notification in the primary app would possibly seem like this:

And receiving a push notification in cellular software on Android would perhaps seem like this:

Receiving and processing notifications

If the cellular software is lively, the notification is delivered straight away to the applying. If a notification handler is related to the software, it’s executed. You may request a big batch of knowledge from the primary software on this handler if needed. As a result, the scale of a push notification is restricted, and it’s unattainable to switch vital quantities of knowledge in it.

If the cellular software is working within the background (inactive) or not working in any respect (unloaded from reminiscence), the working system displays the notification. In this case, a sound alert and a sticker are used. On iOS, the sticker will likely be put in after the cellular software icon on the house display screen. On Android, it units the quantity that will probably be displayed within the message on the notification panel. After the person clicks on the notification, the cellular software will likely be activated (or launched), and the notification handler will probably be executed (if related).

Facebook
Twitter
Pinterest
WhatsApp

Related Articles

Latest Articles