norkunas / onesignal-php-api

OneSignal API for PHP
MIT License
234 stars 83 forks source link

New API v11 #172

Open rcerljenko opened 1 year ago

rcerljenko commented 1 year ago

Hi,

Onesignal released a new API version v11 => https://documentation.onesignal.com/reference

Will you add new methods to support it?

norkunas commented 1 year ago

Hey, maybe someday, in the meantime contributions are welcome :)

rcerljenko commented 1 year ago

Ok. I'll take a swing at it when i catch time... :)

norkunas commented 1 year ago

I just think that while introducing new api's we can simplify the things without using Symfony OptionsResolver component and instead rely on phpdocs, so if people are using static analysis tools they could find problems before shipping the code.

Something like:

class SubscriptionCreatePayload {
  /**
   * @param 'Email'|'SafariPush'|... $type
   */
  public function __construct(
    private readonly string $type,
    // ..all other props
  }
}

$oneSignal->subscriptions->create($payloadObject)

But this would be a new major and php version constraint will need to be increased

rcerljenko commented 1 year ago

yeah... anyway I'm looking at the refefrence now and they really did a big overhaul... deprecated a lot of stuff

rcerljenko commented 10 months ago

@norkunas I finally managed to do some initial work :)