[Discontinued] Push Notification: receive notification through onesignal

1. Introduction

Extension name: Push Notification
Through this extension, you can receive and send notifications through OneSignal SDK. You will be able to receive messages even with the application closed.

Latest Version: 1.0
Released: 2020-07-15T07:46:00Z
Last Updated: 2020-07-15T07:46:00Z

2. Designer Properties

image

In this field, you will put the AppId of the onesignal. Check this link for steps to obtain it.

3. Documentation

Methods

I advise you to use the extension produced by @Jerin_Jacob , if you want to send notifications with more resources.
[Free] Extension OneSignalSend | Send onesignal notification from app itself | October Version 5 , Send by custom filter - Extensions - Kodular Community

  • Send Tags
    Send the tags.
    component_method (86)
    tags ~ dictionary
    Example
    blocks (100)
  • Get Tags
    Gets the tags, returning it in TagsAvailable.
    component_method (87)
  • Delete Tags
    Deletes one or more tags that were previously set on a user.
    component_method (88)
    tags ~ list
    Example
    blocks - 2020-07-15T032408.627
  • Clear OneSignal Notifications
    Clear onesignal notifications.
    component_method (89)

Events

  • Tags Available
    Returns the tags.
    component_event (30)
    tags ~ dictionary
  • Notification Received
    Event triggered when receiving any notification.
    component_event (32)
    id ~ text
    title ~ text
    payload ~ text
  • Notification Opened
    Event triggered when opening the notification.
    component_event (31)
    id ~ text
    title ~ text
    payload ~ text
  • OnSuccess
    Returns if successful in sending the message.
    component_event (33)
    response ~ dictionary
  • OnFailure
    Returns if there was an error sending the message.
    component_event (34)
    response ~dictionary

Properties

  • Get User Id
    Gets the subscription id.
    component_set_get (16)
    return ~ text
  • Enable Vibrate
    Enable vibration when receiving notification. (DEFAULT: TRUE)
    blocks - 2020-07-15T034050.489
    input ~ boolean
  • Enable Sound
    Play sound when receiving notification. (DEFAULT: TRUE)
    blocks - 2020-07-15T034112.586
    input ~ boolean
  • Set In Focus Displaying
    Setting to control how OneSignal notifications will be shown when one is received while your app is in focus.(DEFAULT: 1)
    blocks - 2020-07-15T034423.693
    input ~ number
    None āžœ 0 (Notification will not be displayed while app is in focus)
    InAppAlert āžœ 1 (Native alert dialog display)
    Notification āžœ 2 (Native notification display while user has app in focus)

4. Downloads

5. Open Source

6. Credits

Thank you very much App Inventor, for being part of my life :heart:

7.Donate

If you liked my work, donate me any amount so that I can remain motivated to create free and open source extensions.
https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=QJ76K7BA7KD3A&currency_code=USD&source=url

14 Likes

Thank you for this great work
i have just one comment about this to make it clear for people who doesn't know what do u mean

i've used onesignal before it's true that if you opened the app and close it you will still can receive notifications but if the user close it from activities it will kill the app and won't receive any notification it's not a Background service

2 Likes

And it would be great to include the rest of methods

1 Like

(added to FAQ)

2 Likes

Great Work, But this extension not working in NIOTRON builder. please look in this. The error is dx execution failed.

1 Like

I will analyze. But doesn't NORTON already have a similar component in its constructor?

hi @Jarlissonlira2
when I use this block to open another screen there is a 2 seconds delay.

blocks

the app first open Screen1 and after to seconds it performs the action and Screen3 opens.

is there a fix for this?

PS: I am using Kodular!

1 Like

You should ask in the Kodular forum !!

2 Likes

Hi! but this the original post for this extension by @Jarlissonlira2 so I thought about asking him here!

1 Like

Regardless, you may be using different components only found in Kodular/the extension may work in a different way on Kodular. App Inventor and Kodular are quite different and not generally compatible, therefore it is always best to ask in the forum of the distribution you are developing on.

1 Like

Hi @TIMAI2 I will pay attention next time, Thank you :slightly_smiling_face:

2 Likes

yes they have but they have outdated android support library. if we use this extension with mobile ads component of that (niotron) builder then apk not build error cause dx execution failed.

Im trying to test the notification extension just adding it ant setting up the OneSingal's appid (after setting it with firebase keys) , but the device is shown in audience as "Missing Android Support Library". Is it normal? i have read on another post that the extension needs to be rebuild to use AndroidX libraries API 29?

Congratulations, very useful plugin. I'm trying to use it too. I have made all the adjustments but still cannot receive notifications. A topic, video, blog etc. that explains how to do it. Is there?

I am having the exact same issue. I am hoping that he will update?

@Jarlissonlira2 is it possible that I'm just doing something wrong?

Not only on such case but even if user block notification for the app

U dont have setup of this external library on lib directory it work well on my case

Hi, How to setup this please, any detailed thread ?

Can this notification be set on time? For example, "show every 25th of the month".

More info here