Skip to content

Commit 7d1d812

Browse files
valentintintinnorkunas
authored andcommitted
Add field "apns_push_type_override" #133 (#134)
* Add field "apns_push_type_override" There is a change in OneSignal API for VOIP : Issue Github This is the OneSignal API with the new field : Here * Add tests for "apns_push_type_override" * Fix CI
1 parent 7c86be0 commit 7d1d812

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/Resolver/NotificationResolver.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ public function resolve(array $data): array
222222
->setAllowedTypes('external_id', 'string')
223223
->setDefined('web_push_topic')
224224
->setAllowedTypes('web_push_topic', 'string')
225+
->setDefined('apns_push_type_override')
226+
->setAllowedTypes('apns_push_type_override', 'string')
227+
->setAllowedValues('apns_push_type_override', ['voip'])
225228
->resolve($data);
226229
}
227230

tests/OneSignal/Tests/Resolver/NotificationResolverTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ public function testResolveWithValidValues(): void
117117
'email_from_address' => 'value',
118118
'external_id' => 'value',
119119
'web_push_topic' => 'value',
120+
'apns_push_type_override' => 'voip',
120121
];
121122

122123
$expectedData = $inputData;
@@ -207,6 +208,7 @@ public function wrongValueTypesProvider(): iterable
207208
yield [['email_from_address' => 666]];
208209
yield [['external_id' => 666]];
209210
yield [['web_push_topic' => 666]];
211+
yield [['apns_push_type_override' => 666]];
210212
}
211213

212214
/**

0 commit comments

Comments
 (0)