php-onesignal-sdk
php-onesignal-sdk copied to clipboard
Error When Trying To Create App
I keep getting this error when I try to create an app:
stdClass Object
(
[status] =>
[code] => 400
[response] => stdClass Object
(
[errors] => Array
(
[0] => Your subdomain must only contain lowercase letters, numbers, and dashes (not as a starting or ending character) and must be between 4 and 14 characters long.
)
)
)
This is the code I'm using to create an app:
use NNV\OneSignal\OneSignal;
use NNV\OneSignal\API\App;
$oneSignal = new OneSignal("<Auth Key Here>");
$app = new App($oneSignal);
$appData = [
'name' => 'My App',
'chrome_web_origin' => "http://my-domain.com",
'chrome_web_sub_domain' => "https://subdomain.os.tc",
'apns_env' => 'production'
];
$response = $app->create($appData);
echo "<pre>", print_r($response), "</pre>";
Any help in fixing this issue is greatly appreciated. :)
@MejorCodigo I think you try to remove https:// (or/and .os.tc) from your subdomain :smiley:!