Yes you make an app in web2py that subscribes to one or many pusher
notification channels. That channels are created by you in your html of
your web2py app.
 your web2py server sends notifications to pusher.com using python code
,and your webpages subscribes the same notifications using javascript. you
can go crazy and create rooms etc.
The docs from pusher are very informative.
Regards
António

Em sex., 20 de nov. de 2020 às 18:28, Christian Varas <
chriiisti...@gmail.com> escreveu:

> Hi! I need to implement this and receive the notifications in the phone
> android/iOS. For this do I need to make my own app? Or do you use an app
> who can subscribe to push notifications in pusher.com ?
> This is off topic but any recommendation is appreciated
>
> Cheers.
> Chris
>
> El El vie, 20 de nov. de 2020 a la(s) 13:45, mostwanted <
> godirao...@gmail.com> escribió:
>
>> Gratitude
>>
>> On Friday, November 20, 2020 at 10:33:10 AM UTC+2 Ramos wrote:
>>
>>> create a module inside web2py
>>> API_Pusher.py
>>>
>>> import pusher
>>>
>>> def pusher_client():
>>>     return pusher.Pusher(
>>>                           app_id='yourid',
>>>                           key='yourkey',
>>>                           secret='yoursecret',
>>>                           cluster='eu',
>>>                           ssl=True
>>>                         )
>>>
>>>
>>> Then inside your controllers
>>>
>>> from API_Pusher import pusher_client
>>> ...
>>> pusher_client().trigger('fileit', 'plannerPesos',  {'message':
>>> "PlaySound('ok')"})
>>>
>>> Em sex., 20 de nov. de 2020 às 07:41, mostwanted <godir...@gmail.com>
>>> escreveu:
>>>
>>>> Hey Ramos, I was able to successfully register the app on pusher.com.
>>>> towards step 4 its says i should copy this code:
>>>> *CODE:*
>>>> curl -H "Content-Type: application/json" \
>>>>      -H "Authorization: Bearer
>>>> 9C9232906DFC6C8F8115926CC30D637945EB75F60467DA77977C399C4235E61C" \
>>>>      -X POST "
>>>> https://733e2240-aca0-4a12-a5a9-c3b1422b9063.pushnotifications.pusher.com/publish_api/v1/instances/733e2240-aca0-4a12-a5a9-c3b1422b9063/publishes";
>>>> \
>>>>      -d
>>>> '{"interests":["hello"],"web":{"notification":{"title":"Hello","body":"Hello,
>>>> world!"}}}'
>>>>
>>>> to my console! Which console is this one? My desktop console? I'm
>>>> hosted with pythonanywhere.com, can i use the Bash console in my
>>>> dashboard?
>>>>
>>>> On Tuesday, November 17, 2020 at 7:53:20 AM UTC+2 mostwanted wrote:
>>>>
>>>>> Thanks alot Ramos, think this will work, very little work needs to be
>>>>> done here, I'll try it out.
>>>>>
>>>>> On Tuesday, November 17, 2020 at 1:06:10 AM UTC+2 Ramos wrote:
>>>>>
>>>>>> Why reiventing the wheel ???
>>>>>> https://pusher.com/
>>>>>>
>>>>>> I use it with web2py and works like a charm
>>>>>>
>>>>>>
>>>>>> Em seg., 16 de nov. de 2020 às 08:44, mostwanted <godir...@gmail.com>
>>>>>> escreveu:
>>>>>>
>>>>>>> So far all I have been able achieve is asking the user for
>>>>>>> permission to send them notifications & if they accept all that happens 
>>>>>>> is
>>>>>>> that everytime they open the app they get a greetings notification,
>>>>>>> achieving that was not complicated because it was straight forward, I
>>>>>>> placed the code in my main.js script & it runs everytime the service 
>>>>>>> worker
>>>>>>> gets registered.
>>>>>>>
>>>>>>> *CODE:*
>>>>>>> Notification.requestPermission(result => {
>>>>>>>   if (result === 'granted') {
>>>>>>>     showNotification('Welcome to My App™', 'Everything Services™')
>>>>>>>   }
>>>>>>> });
>>>>>>>
>>>>>>> function showNotification(title, message) {
>>>>>>>   if ('Notification' in window) {
>>>>>>>     navigator.serviceWorker.ready.then(registration => {
>>>>>>>       registration.showNotification(title, {
>>>>>>>         body: message,
>>>>>>>         tag: 'my-app',
>>>>>>>         icon:'/init/static/images/icon_192x192.png',
>>>>>>>         badge:'/init/static/images/icon_128x128.png',
>>>>>>>         vibrate: [200, 100, 200, 100, 200, 100]
>>>>>>>       });
>>>>>>>     });
>>>>>>>   }
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> On Monday, November 16, 2020 at 10:31:10 AM UTC+2 mostwanted wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> Has anyone been able to implement push notifications on their
>>>>>>>> web2py apps?
>>>>>>>>
>>>>>>>> I need a working application with some examples on how to implement
>>>>>>>> this for one of my applications.
>>>>>>>>
>>>>>>>> I've been looking at the "web-push-book (
>>>>>>>> https://web-push-book.gauntface.com/how-push-works/)" but I cant
>>>>>>>> put it together in my head.
>>>>>>>>
>>>>>>>> What I wanna achieve is relatively basic, I have an applivcation
>>>>>>>> that offers information on services & products sold in my area, so 
>>>>>>>> what I
>>>>>>>> want is to be able to send notifications everytime a new service or 
>>>>>>>> product
>>>>>>>> is registered.
>>>>>>>>
>>>>>>>> If anyone has any idea on how I can easily implement this please
>>>>>>>> help me.
>>>>>>>>
>>>>>>>> Regards;
>>>>>>>>
>>>>>>>> Mostwanted
>>>>>>>>
>>>>>>> --
>>>>>>> Resources:
>>>>>>> - http://web2py.com
>>>>>>> - http://web2py.com/book (Documentation)
>>>>>>> - http://github.com/web2py/web2py (Source code)
>>>>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>>>>> ---
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "web2py-users" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to web2py+un...@googlegroups.com.
>>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/web2py/01da1065-f7d3-4394-9014-a424639bef03n%40googlegroups.com
>>>>>>> <https://groups.google.com/d/msgid/web2py/01da1065-f7d3-4394-9014-a424639bef03n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>
>>>>>>
>>>>>>> --
>>>> Resources:
>>>> - http://web2py.com
>>>> - http://web2py.com/book (Documentation)
>>>> - http://github.com/web2py/web2py (Source code)
>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "web2py-users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to web2py+un...@googlegroups.com.
>>>>
>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/web2py/ca28be9e-6720-4993-9f68-1a42cf57a2c1n%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/web2py/ca28be9e-6720-4993-9f68-1a42cf57a2c1n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/web2py/fc9b108c-7685-455f-8b22-806860ce3eddn%40googlegroups.com
>> <https://groups.google.com/d/msgid/web2py/fc9b108c-7685-455f-8b22-806860ce3eddn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/CA%2Bs%2BuJvsebj7V1y%2B%2Bi_GbPYs8VhEefEGNUGdNuC%2BQRk2wJ%2BRTg%40mail.gmail.com
> <https://groups.google.com/d/msgid/web2py/CA%2Bs%2BuJvsebj7V1y%2B%2Bi_GbPYs8VhEefEGNUGdNuC%2BQRk2wJ%2BRTg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAEM0BxO7Kgc4sJPQsasmSJ6v5f-OGNT3-g%3D4-1SbdVqvyR9nzQ%40mail.gmail.com.

Reply via email to