diff --git a/README.md b/README.md index 4283567..58990bb 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ $ composer require edamov/pushok 'AAAABBBBCC', // The Key ID obtained from Apple developer account 'team_id' => 'DDDDEEEEFF', // The Team ID obtained from Apple developer account 'app_bundle_id' => 'com.app.Test', // The bundle ID for app obtained from Apple developer account - 'private_key_path' => __DIR__ . 'private_key.p8', // Path to private key + 'private_key_path' => __DIR__ . '/private_key.p8', // Path to private key 'private_key_secret' => null // Private key secret ]; @@ -68,7 +68,7 @@ $payload = Payload::create()->setAlert($alert); $payload = $payload->setSound('default'); //add custom value to your notification, needs to be customized -$payload = $payload->setCustomValue("key",$value); +$payload = $payload->setCustomValue('key', 'value'); $deviceTokens = ['', '', '']; diff --git a/src/Payload/Alert.php b/src/Payload/Alert.php index de9c677..c51eda2 100644 --- a/src/Payload/Alert.php +++ b/src/Payload/Alert.php @@ -22,8 +22,8 @@ class Alert implements \JsonSerializable { const ALERT_TITLE_KEY = 'title'; const ALERT_BODY_KEY = 'body'; - const ALERT_TITLE_LOC_KEY = 'title-loc-key'; - const ALERT_TITLE_LOC_ARGS_KEY = 'title-loc-args'; + const ALERT_TITLE_LOC_KEY = 'loc-key'; + const ALERT_TITLE_LOC_ARGS_KEY = 'loc-args'; const ALERT_ACTION_LOC_KEY = 'action-loc-key'; const ALERT_LOC_KEY = 'loc-key'; const ALERT_LOC_ARGS_KEY = 'loc-args'; diff --git a/tests/Payload/AlertTest.php b/tests/Payload/AlertTest.php index 878bf42..84e5d68 100644 --- a/tests/Payload/AlertTest.php +++ b/tests/Payload/AlertTest.php @@ -32,9 +32,9 @@ public function testSetBody() public function testSetTitleLocKey() { - $alert = Alert::create()->setTitleLocKey('title-loc-key'); + $alert = Alert::create()->setTitleLocKey('loc-key'); - $this->assertEquals('title-loc-key', $alert->getTitleLocKey()); + $this->assertEquals('loc-key', $alert->getTitleLocKey()); } public function testSetTitleLocArgs() @@ -84,8 +84,8 @@ public function testAlertConvertingToJson() $alert = Alert::create() ->setTitle('title') ->setBody('body') - ->setTitleLocKey('title-loc-key') - ->setTitleLocArgs(['title-loc-arg']) + ->setTitleLocKey('loc-key') + ->setTitleLocArgs(['loc-arg']) ->setActionLocKey('action-loc-key') ->setLocKey('loc-key') ->setLocArgs(['loc-arg']) @@ -93,7 +93,7 @@ public function testAlertConvertingToJson() ->setMutableContent(true); $this->assertJsonStringEqualsJsonString( - '{"title":"title","body":"body","title-loc-key":"title-loc-key","title-loc-args":["title-loc-arg"],' . + '{"title":"title","body":"body","loc-key":"loc-key","loc-args":["loc-arg"],' . '"action-loc-key":"action-loc-key","loc-key":"loc-key","loc-args":["loc-arg"],' . '"launch-image":"launch-image","mutable-content":1}', $alert->toJson()