OneSignalPlus | Get PlayerID, Send Push, Add Tag, etc [Donation]



This extension is an further development from the previous version.
in this version I added an addtag feature for certain users.
the advantages of using this tag feature are explained on this page.

example block

you also can delete the tags, just set the key with the tag which you want to delete and set the value with blank text.

if you need this component, you can send a little donation for further development. You can send donations to my paypal here . Donations can be of any value
send a personal message to me after you give a donation, I will send the download link via email.


Hi @wanttobe,

You are doing nice work but i merged all your topics about the same extension together. This way we can keep the forum as clean as possible. I hope you understand.


this is the further development from OneSignalPlus extension.
in this version, i have added the feature so you can send push notification to specific segment

if you need this component, you can send a donation for further development. You can send donations to my paypal here . Donations can be of any value
send a personal message to me after you give a donation, I will send the download link via email.

Extension OneSignalSend

here is the sample block joined with Web Extension

Sending notifications using Onesignal API

hola, estoy usando esta Extension y quiero comentarles que funciona perfectamente!
Uso Android 8.0



thanks a lot for your informations


Hello, I made a donation, you could send me the onesignal plus extension to my email


Just made a donation, can you send me the onesignal plus extension to my email, please?


Send a pm to the developer as stated in his post.


Please help with correct format for include_player_id. All efforts to put string values into the array from mysql database give error. I used your extension to get playerId and insert into the database. If i paste the value directly my code works.
I’m dealing with just one value of playerId, not an array.

Thank you.


try put php variable into your function

    function sendMessage($playerID){
    $fileds = array(
        'app_id => "your app ID from OneSignal",
        'include_player_ids' => array($playerID)',

$playerID = "put your player ids here"; 


Thanks for your response.
This is what I did, fetching string from my database but onesignal sees null.
I guess I’m still doing something wrong.

// …fetch from database
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {

function sendMessage(){
$content = array("en" => $_POST['message']);
$fields = array(
'app_id' => "my app id",
'include_player_ids' => array($row["playerId"]),
'contents' => $content
	$fields = json_encode($fields);
	print("\nJSON sent:\n");


just apply my code above, your code was wrong anyway.


I desire to push message to an individual user. I have tried your code, it didn’t work for me. Can you please show the complete code to include message to be sent. Maybe that’s where I’m getting things wrong. I hope to order the new version of your extension this week if you have alternative payment processing. I don’t have paypal account presently.
Thank you.


Replying to myself. I got it done. For those who may be interested, to send onesignal push notification to a user, see the script below.:

function sendMessage(){
$content = array(“en” => $_POST[‘message’]);
$fields = array(
‘app_id’ => “your app id here”,
‘include_player_ids’ => array($_POST[‘playerId’]),
‘contents’ => $content

$fields = json_encode($fields);
print("\nJSON sent:\n");

	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, "");
	curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
	curl_setopt($ch, CURLOPT_HEADER, FALSE);
	curl_setopt($ch, CURLOPT_POST, TRUE);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);

	$response = curl_exec($ch);
	return $response;

$response = sendMessage();
$return[“allresponses”] = $response;
$return = json_encode( $return);
print("\n\nJSON received:\n");

I used extension to get playerId for a user, save to mysql database and sent it to the user by email on first run of the app, Phone anti-theft and anti-abduction app. In the event that the phone is stolen, the owner may prompt phone call or use of the app by sending onesignal push notification to the device with the player ID form my website.
My discovery that I could not explain:
Getting data from the web

$message = $_POST[‘message’];
$playerId = $_POST[‘playerId’];
If substitute the string value on the left in the above script, onesignal will see null and present error but if I substitute the string value on the right, the message sends successfully.
Can someone tell me why?
For this reason, I could not get string value from the database and use directly.
$row[“playerId”] will give null error.
I have been able to add an important feature to phone app, “prompt a call”. Thanks to @wanttobe for Get Player ID.
See user’s face feature: Thanks to @Taifun camera extension.
Try it:


What function does the TagResponse block fulfill? Is it possible to modify it so that when the receiver of the notification presses and can go to a specific window?


thanks for contributing!
my email
I wish your success.


@618dccc00496f8e95e68 what about sending a PM to the developer? probably posting your email address in a public forum is not a good idea, is it? do you want to attract loads of spam in your inbox?


some people ask me, “how do you change the small icon?
Based on the document here, you can enter your small icon with the name of your icon to be ic_stat_onesignal_default into the res / … folder (see document)


Please, send your email by PM.
Except, if you want spam message attack your email :smiley: