Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish notification system #1441

Open
voltan opened this issue Dec 27, 2016 · 19 comments
Open

Finish notification system #1441

voltan opened this issue Dec 27, 2016 · 19 comments

Comments

@voltan
Copy link
Member

voltan commented Dec 27, 2016

No description provided.

@voltan voltan added this to the Version 2.6 milestone Dec 27, 2016
@voltan
Copy link
Member Author

voltan commented Feb 5, 2017

On my tests new notification service work well , need update all modules to use new service

@Marc-pi
Copy link
Member

Marc-pi commented Feb 5, 2017

How do you see it work? I mean on use side. How to register to notification on content? Like xoops way? crontab or not?

@voltan
Copy link
Member Author

voltan commented Feb 5, 2017

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

@Marc-pi
Copy link
Member

Marc-pi commented Feb 5, 2017

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??

@voltan
Copy link
Member Author

voltan commented Feb 5, 2017

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

@Marc-pi
Copy link
Member

Marc-pi commented Feb 5, 2017

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.

@Marc-pi
Copy link
Member

Marc-pi commented Feb 6, 2017

@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

@voltan
Copy link
Member Author

voltan commented Feb 7, 2017

Please still wait for it , some other checks needed

@Marc-pi
Copy link
Member

Marc-pi commented Feb 7, 2017

We will fix regression (wrong message send, recession on guide)

@Marc-pi
Copy link
Member

Marc-pi commented Feb 7, 2017

@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?

@voltan
Copy link
Member Author

voltan commented Feb 8, 2017

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

@voltan
Copy link
Member Author

voltan commented Feb 8, 2017

I Add todo list for this service

@voltan
Copy link
Member Author

voltan commented Feb 11, 2017

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/

@Marc-pi
Copy link
Member

Marc-pi commented Feb 11, 2017

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.

@voltan
Copy link
Member Author

voltan commented Feb 12, 2017

I try finish it this week , need build test app too

@Marc-pi
Copy link
Member

Marc-pi commented Feb 12, 2017

Why not cafeyab?

@voltan
Copy link
Member Author

voltan commented Feb 12, 2017

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

@voltan
Copy link
Member Author

voltan commented Feb 12, 2017

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";
        }

@voltan
Copy link
Member Author

voltan commented Feb 14, 2017

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

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

No branches or pull requests

2 participants