pi
pi copied to clipboard
Finish notification system
On my tests new notification service work well , need update all modules to use new service
How do you see it work? I mean on use side. How to register to notification on content? Like xoops way? crontab or not?
we talked about it before , at this moment notification just send mail / message / sms , I just add service than for many actions notification module not needed to install
Yes, i know, you made the core side, but about yet side? Notification on new content / user register on notification per module, category, new content, edited content??
No , It just do current notification module job, than for send mail and message , install notification module not required
at this moment we don't have any solution for send notification like this , its really useful ? if needed we can make it on notification on next versions, please open issues for it
Yes, I know what a service is :-) Notification on comments are highly needed (notif me on thread i commented in) We need also to sync with Apps.
@voltan what about the notification module ? we can delete/remove it?
if needed we can make it on notification on next versions, please open issues for it
already opened there https://github.com/pi-engine/guide/issues/740
Please still wait for it , some other checks needed
We will fix regression (wrong message send, recession on guide)
@voltan well, we will rollback your change in guide module
we have an architecture/design stake there, we have to think a little bit further on about this notification needs :
- either make notification module a core module (like page, widget, etc.)
- either merge it into system (but makes system too heavy)
Notification module is currently able to :
- send SMS
- manage cron
- send ping to message module (notification tab)
- send mail (warn user about the notification he received)
Only message module is visible from end user : there are 2 tables (message/notif) in Message module To sync notification with Android/iOS apps, we'll need to sync notif table of message module
@taiwen your thoughts on this?
Hello
I see this problem : https://github.com/pi-engine/guide/issues/888 , I will fix it tomorrow , My plan is : 1- have notification service to send mail and if message module install send message, without need any external module 2- corn should part of core service , at this moment I add function on notification but I think about move it as new service 3- send sms can be part of notification module , but should call from notification service , this part need update 4- for send mobile app notification we need use google service or users run push server ( not easy and expensive ) , than we need think more about this , but it should e part of notification module , and call from notification service
than all notification features should call from notification service , if notification module installed extra services can work and if not installed minimal service work
I Add todo list for this service
for send notification on mobile apps , I want use it : https://firebase.google.com and this php example http://sab99r.com/blog/firebase-cloud-messaging-fcm-php-backend/
Yes, seems to be the right platform to use. I will discuss with apps Dev on Monday, but I've not doubt.google cloud messaging have been repackaged in firebase platform. Good shot.
I try finish it this week , need build test app too
Why not cafeyab?
I have plan to rewrite cafeyab app ( full online ) but before that and for test , I see some test code available , I can work by test codes just replace some field needed , cafeyab need to many change I think
example code :
$url = 'https://fcm.googleapis.com/fcm/send';
$serverKey = 'MY_KEY';
$data = array(
'id' => 123,
'title' => 'my title',
'body' => 'my body',
);
$fields = array();
$fields['data'] = $data;
$fields['priority'] = 'high';
$fields['to'] = '/topics/TOPIC_NAME';
$config = array(
'adapter' => 'Zend\Http\Client\Adapter\Curl',
);
$client = new \Zend\Http\Client($url, $config);
$headers = $client->getRequest()->getHeaders();
$headers->addHeaderLine('Authorization', 'key='.$serverKey);
$client->setMethod('POST');
$client->setEncType('application/json');
$client->setRawBody(json_encode($fields));
$client->setHeaders($headers);
$response = $client->send();
if ($response->isSuccess()) {
echo "Work";
}else{
echo "Not work";
}
Firebase Cloud Message added on notification service , I waiting for finish test, some other options like color and sound can be add after finish tests