Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sendNotificationCustom method send to all instead of "include_aliases" #193

Open
syamsoul opened this issue Jun 3, 2024 · 1 comment
Open

Comments

@syamsoul
Copy link

syamsoul commented Jun 3, 2024

the code below will send to all instead of specific users...

however, i already found the issue,,, i will create PR for that

$params = [
      'contents' => [
          'en' => $message,
      ],
      'target_channel' => 'push',
      'include_aliases' => [
          'external_id' => ["user_{$user->id}"],
      ],
];

OneSignalClient::async()->sendNotificationCustom($params);
@syamsoul
Copy link
Author

syamsoul commented Jun 3, 2024

temporary workaround (while waiting fix released):

just add included_segments and put any random value...

$params = [
    'contents' => [
        'en' => $message,
    ],
    'target_channel' => 'push',
    'include_aliases' => [
        'external_id' => ["user_{$user->id}"],
    ],
    'included_segments' => ["not_exist_just_a_temp_workaround"], // TODO: this is for temporary, after the fix released, can update package and remove this
];

OneSignalClient::async()->sendNotificationCustom($params);
        

@syamsoul syamsoul changed the title sendNotificationCustom method send to all instead of external_id sendNotificationCustom method send to all instead of "include_aliases" Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant