Skip to content

Releases: Multek-Company/laravel-onesignal

v2.2.0 — derived resync + OneSignalObserver

Choose a tag to compare

@rodrigocoliveira rodrigocoliveira released this 30 Jul 02:44
cb69db7

Owns the full OneSignal lifecycle with far less app-side code: add one attribute to your model and the package keeps OneSignal in step with it.

Automatic sync via #[ObservedBy]

#[ObservedBy(OneSignalObserver::class)]
class User extends Authenticatable
{
    use HasOneSignal;
}

No field list, no wasChanged() guard, no enablement check, no queue lookup. On every save the observer asks oneSignalPayloadChanged(), which builds the payload from the model's current attributes and from its original attributes and compares — so a tag added to getOneSignalTags() is covered the day it lands. Handles create, update, delete (leaving soft-deleted profiles intact until forceDelete()) and restore.

The README documents the boundary rather than implying full coverage: a related row's content changing, and many-to-many attach/detach, fire no event on the user, so those need an observer on the related model plus scheduled onesignal:backfill as reconciliation.

Async delete

deleteFromOneSignalAsync() and Jobs\DeleteUserFromOneSignal complete the delete path with the same retry policy as sync — a transient 5xx no longer permanently orphans a profile. A 404 is treated as a completed erasure: logged at debug, not retried.

Lazy manager reads

OneSignalManager reads enabled, app_id and track_events from config() at call time instead of snapshotting them, and builds the SDK client on first use, so a disabled package never constructs a Guzzle client. Tests no longer need app()->forgetInstance(OneSignalManager::class) to observe a config change.

Before you upgrade

Three compatibility notes in UPGRADE.md: the removed protected validatedOneSignalPhone() helper (an override of it now silently stops running), both jobs becoming afterCommit, and direct OneSignalManager construction following config when no explicit enabled: argument is passed.

Full notes in CHANGELOG.md.

v2.1.0

Choose a tag to compare

@rodrigocoliveira rodrigocoliveira released this 29 Jul 21:22
021b757

What's Changed

Full Changelog: v2.0.1...v2.1.0

v2.0.1 — client SDK integration guide

Choose a tag to compare

@rodrigocoliveira rodrigocoliveira released this 29 Jul 20:48
29ce1de

Documentation-only patch on top of v2.0.0.

Adds docs/client-sdk-integration.md, explaining how this package (the server half — tags, properties, Email/SMS subscriptions, events, sending) pairs with OneSignal's web and mobile SDKs (the device half, which is the only thing that can create a push subscription):

  • external_id as the join key that merges browser push, mobile push, email and SMS into one OneSignal user
  • Web SDK setup wired to your auth state
  • Mobile apps that wrap your site in a WebView — web push does not work inside WKWebView/Android WebView, so the native SDK owns push and the page relays auth over a bridge
  • Rules for a consistent multi-SDK setup: single writer for user data, Identity Verification, cross-platform duplicates, staying on the v16/v5 user model

No code changes — upgrading from v2.0.0 is a no-op.

🤖 Generated with Claude Code

v2.0.0 — standalone package

Choose a tag to compare

@rodrigocoliveira rodrigocoliveira released this 29 Jul 13:56
f43ea0f

laravel-onesignal is now fully standalone — the multek/laravel-customer-engagement dependency is gone, and the package owns the complete OneSignal lifecycle: profiles (identity + native properties + Email/SMS subscriptions), segmentation tags, custom events, and push notifications.

Breaking changes

  • Removed multek/laravel-customer-engagement dependency, OneSignalDriver, and driver auto-registration — consumers needing the driver architecture stay on ^1.1
  • Identity fields (email/phone/name) are no longer copied into data tags; email/phone become native Email/SMS subscriptions instead
  • Manager methods return null/[] when the package is disabled (ONESIGNAL_ENABLED=false or empty app_id)
  • syncToOneSignalAsync() dispatches nothing when disabled

Added

  • Enabled/disabled gate (zero keys, zero HTTP calls in local/test)
  • ONESIGNAL_TRACK_EVENTS guard (Free plan rejects custom events with 403)
  • Single-call createUser upsert sync — proven against the live API (no subscription duplication on re-sync)
  • HasOneSignal v2 trait: email/phone (E.164-validated), language/timezone/country getters
  • php artisan onesignal:backfill {--dry-run} {--chunk=250}
  • Env-gated live smoke suite (tests/Live/)

See UPGRADE.md for the full v1 → v2 migration guide.

🤖 Generated with Claude Code

v1.1.0

Choose a tag to compare

@rodrigocoliveira rodrigocoliveira released this 28 Jul 20:06

Added

  • The engagement driver maps the Customer DTO's language, timezone and country fields (first-class in laravel-customer-engagement v1.1) to OneSignal's native user properties — never to data tags, which are plan-limited (#3).
  • OneSignalManager::updateUser($externalId, $tags, $properties) and an optional $properties argument on createUser() (language, timezone_id, country).

Changed

  • Requires multek/laravel-customer-engagement ^1.1.

Full Changelog: v1.0.1...v1.1.0

v1.0.1

Choose a tag to compare

@rodrigocoliveira rodrigocoliveira released this 28 Jul 20:01

Fixed

  • updateUserTags() now sends the correct UpdateUserRequest body to DefaultApi::updateUser — v1.0.0 sent a User model, which OneSignal ignored, producing users with no data tags (#1).
  • updateUserTags()/removeUserTags() return type corrected to PropertiesBody (was User, throwing a TypeError even on success).

Upgrade

composer update multek/laravel-onesignal

Then re-run your user sync backfill (idempotent) so existing users get their tags applied.

Full Changelog: v1.0.0...v1.0.1

v1.0.0

Choose a tag to compare

@rodrigocoliveira rodrigocoliveira released this 01 Apr 18:24