Skip to content

Commit b9cd06c

Browse files
authored
Merge pull request #198 from throcha3/fix/onesignal-url-optional
Get API URL from env or pass it as optional parameter in client constructor
2 parents ce1c399 + 3c0703f commit b9cd06c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/OneSignalClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ public function callback(Callable $requestCallback)
7676
* @param $userAuthKey
7777
* @param int $guzzleClientTimeout
7878
*/
79-
public function __construct($appId, $restApiUrl, $restApiKey, $userAuthKey, $guzzleClientTimeout = 0)
79+
public function __construct($appId, $restApiKey, $userAuthKey, $guzzleClientTimeout = 0, $restApiUrl = null)
8080
{
8181
$this->appId = $appId;
82-
$this->restApiUrl = $restApiUrl;
82+
$this->restApiUrl = $restApiUrl ?? config('onesignal.rest_api_url');
8383
$this->restApiKey = $restApiKey;
8484
$this->userAuthKey = $userAuthKey;
8585

0 commit comments

Comments
 (0)