Nextcloud PHP API (master)

IManager extends IApp, INotifier

Interface IManager

Tags
since
9.0.0

Table of Contents

Methods

createNotification()  : INotification
defer()  : bool
Start deferring notifications until `flush()` is called
dismissNotification()  : void
flush()  : void
Send all deferred notifications that have been stored since `defer()` was called
getCount()  : int
getID()  : string
Identifier of the notifier, only use [a-z0-9_]
getName()  : string
Human-readable name describing the notifier
getNotifiers()  : array<string|int, INotifier>
hasNotifiers()  : bool
isFairUseOfFreePushService()  : bool
Whether the server can use the hosted push notification service
isPreparingPushNotification()  : bool
markProcessed()  : void
notify()  : void
prepare()  : INotification
registerApp()  : void
registerNotifier()  : mixed
registerNotifierService()  : void
setPreparingPushNotification()  : void

Methods

defer()

Start deferring notifications until `flush()` is called

public defer() : bool

The calling app should only "flush" when it got returned true on the defer call, otherwise another app is deferring the sending already.

Tags
since
20.0.0
Return values
bool

flush()

Send all deferred notifications that have been stored since `defer()` was called

public flush() : void
Tags
since
20.0.0

getID()

Identifier of the notifier, only use [a-z0-9_]

public getID() : string
Tags
since
17.0.0
Return values
string

getName()

Human-readable name describing the notifier

public getName() : string
Tags
since
17.0.0
Return values
string

hasNotifiers()

public hasNotifiers() : bool
Tags
since
9.0.0
Return values
bool

isFairUseOfFreePushService()

Whether the server can use the hosted push notification service

public isFairUseOfFreePushService() : bool

We want to keep offering our push notification service for free, but large users overload our infrastructure. For this reason we have to rate-limit the use of push notifications. If you need this feature, consider using Nextcloud Enterprise.

Tags
since
23.0.0
Return values
bool

isPreparingPushNotification()

public isPreparingPushNotification() : bool
Tags
since
14.0.0
Return values
bool

prepare()

public prepare(INotification $notification, string $languageCode) : INotification
Parameters
$notification : INotification
$languageCode : string

The code of the language that should be used to prepare the notification

Tags
throws
UnknownNotificationException

When the notification was not prepared by a notifier

throws
AlreadyProcessedException

When the notification is not needed anymore and should be deleted

throws
IncompleteParsedNotificationException

Only to be thrown by the IManager

since
9.0.0
since
30.0.0

Notifiers should throw UnknownNotificationException instead of \InvalidArgumentException when they did not handle the notification. Throwing \InvalidArgumentException directly is deprecated and will be logged as an error in Nextcloud 39.

since
30.0.0

Throws IncompleteParsedNotificationException when not all required fields are set at the end of the manager or after a INotifier that claimed to have parsed the notification.

Return values
INotification

registerApp()

public registerApp(string $appClass) : void
Parameters
$appClass : string

The service must implement IApp, otherwise a \InvalidArgumentException is thrown later

Tags
since
17.0.0

registerNotifier()

public registerNotifier(Closure $service, Closure $info) : mixed

use registerNotifierService instead.

Parameters
$service : Closure

The service must implement INotifier, otherwise a \InvalidArgumentException is thrown later

$info : Closure

An array with the keys 'id' and 'name' containing the app id and the app name

Tags
since
8.2.0
  • Parameter $info was added in 9.0.0

registerNotifierService()

public registerNotifierService(string $notifierService) : void

use the IBootStrap registration context

Parameters
$notifierService : string

The service must implement INotifier, otherwise a \InvalidArgumentException is thrown later

Tags
since
17.0.0

setPreparingPushNotification()

public setPreparingPushNotification(bool $preparingPushNotification) : void
Parameters
$preparingPushNotification : bool
Tags
since
14.0.0

        
On this page

Search results