mcfedr / awspushbundle Goto Github PK
View Code? Open in Web Editor NEWA Symfony Bundle for sending cross platform push notifications, using Amazon SNS
License: MIT License
A Symfony Bundle for sending cross platform push notifications, using Amazon SNS
License: MIT License
If a device is disabled in SNS, an error is thrown preventing the rest of my code from functioning โ can't seem to find a method to check if a device is enabled prior to delivery of method therefore I can't guarantee execution of the rest of my code, what's the normal approach to handle this?
I have error when I try installing plugin:
Notice: Undefined index: platforms In McfedrAwsPushExtension.php line 28:
Hello
collapse_key is compatible only for android devices, for apns we must use apns-collapse-id.
it exist this attribute AWS.SNS.MOBILE.APNS.COLLAPSE_ID now supported by SNS
https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html#sns-attrib-mobile-reserved
in the Mcfedr\AwsPushBundle\Service\Messages we could use the collapseKey to add this message attribute ?
public function send($message, string $endpointArn): void
{
if ($this->debug) {
$this->logger && $this->logger->notice(
"Message would have been sent to $endpointArn",
[
'Message' => $message,
]
);
return;
}
if (!($message instanceof Message)) {
$message = new Message($message);
}
if ($this->platforms !== null && !$message->isPlatformsCustomized()) {
$message->setPlatforms($this->platforms);
}
$messageAttributes = [
'AWS.SNS.MOBILE.APNS.PUSH_TYPE' => ['DataType' => 'String', 'StringValue' => $message->getPushType()],
];
if ($message->getCollapseKey() != Message::NO_COLLAPSE) {
$messageAttributes['AWS.SNS.MOBILE.APNS.COLLAPSE_ID'] = ['DataType' => 'String', 'StringValue' => $message->getCollapseKey()];
}
$this->sns->publish(
[
'TargetArn' => $endpointArn,
'Message' => $this->encodeMessage($message),
'MessageStructure' => 'json',
'MessageAttributes' => $messageAttributes,
]
);
}
In your code you have different payloads keys for FCM and GCM
But according to SNS documentation
you should always use GCM as key, where did you see the FCM information?
Hi,
I have downloaded and tested your code in my Symfony 3 project and it works fine.
I only could test send to one device, but I think that the rest of methods work too.
I can't find any way to set aps data except badge, sound and content-avaliable.
How can I set category for example?
I found on your documentation the customAPNSdata but it seems it encapsulates it outside the aps key.
Could you provide a method to add an array of data the user wants inside aps key?
Thank you!
Hi, Im using symfony 3.4.22 and apear this deprecated
Autowiring services based on the types they implement is deprecated since Symfony 3.3 and won't be supported in version 4.0. You should rename (or alias) the "mcfedr_aws_push.sns_client" service to "Aws\Sns\SnsClient" instead.
my composer has this detail information
"name": "mcfedr/awspushbundle",
"version": "6.11.0",
"source": {
"type": "git",
"url": "https://github.com/mcfedr/awspushbundle.git",
"reference": "8a90e38b8f463e86618be816553f35e9262ad0dc"
},
could I can remove this deprecated?
Hi,
I have a question, is there is any method to unregister the device token?
Thank you!
Hi,
First of all thank you for your great work. I have a question. Can you add the Windows Phone push platforms or can you help me how can I add them to your bundle.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.