Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Error When Trying To Create App #11

Open
MejorCodigo opened this issue Aug 26, 2017 · 1 comment
Open

Error When Trying To Create App #11

MejorCodigo opened this issue Aug 26, 2017 · 1 comment

Comments

@MejorCodigo
Copy link

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' => "https://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. :)

@namnv609
Copy link
Owner

namnv609 commented Oct 9, 2017

@MejorCodigo I think you try to remove https:// (or/and .os.tc) from your subdomain 😃!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants