vincentmorneau / apex-pwa

A complete guide for turning an APEX application into a Progressive Web App
MIT License
82 stars 26 forks source link

Endpoint, auth and p256dh in oracle table #23

Open guliverNS opened 3 years ago

guliverNS commented 3 years ago

Hi Vincent I have only one step to finish this journey, so please help. This your desciption is great, and it works for all the subscribers. I've made a small changes on pushnotification.js, and now works well for the specific user, when i copy endpoint, auth and p256dh from Firebase and then use those data in my SQL Developer like this:

/***/

declare l_rest_return clob;

l_endpoint VARCHAR2(2000); l_auth VARCHAR2(2000); l_p256dh VARCHAR2(2000); l_title VARCHAR2(2000); l_body VARCHAR2(2000);

l_values VARCHAR2(4000); begin l_endpoint := 'someEndpointFromFirebase'; l_auth := 'someAuthFromFirebase'; l_p256dh := 'someP256dhFromFirebase'; l_title := 'Title'; l_body := 'Body';

l_values := l_endpoint||','||l_auth||','||l_p256dh||','||l_title||','||l_body;

l_rest_return := apex_web_service.make_rest_request( p_url => 'http://myserver:3057/push' -- My custom REST endpoint (1) , p_http_method => 'GET' , p_parm_name => apex_util.string_to_table('endpoint:auth:p256dh:title:body') -- Notification structure (2) , p_parm_value => apex_util.string_to_table(l_values,',') -- Notification Content (3) ); end;

/***/

But I don't know how to get those data and insert them in my oracle table, at the moment when user click on button "Enable notifications". Without that, notifications doesnt have to much sense. I believe that I must do something in the part of the app.js, that I send as an attachment.

So, to resume, my question is

guliverNS commented 3 years ago

OK, I solved it, tnx