itisnajim / strapi-plugin-fcm

Send FCM notifications from your Strapi app.
MIT License
22 stars 11 forks source link

https://server/api/strapi-plugin-fcm/fcm-targets return null data #2

Closed Cosbiome closed 1 year ago

Cosbiome commented 1 year ago

At the time of sending the notification it does not bring me the users configured in the up_users tokenpush and I have tried in different ways to solve it but I understand the documentation completely well or it may be a small bug Captura de Pantalla 2022-08-19 a la(s) 17 04 31 Captura de Pantalla 2022-08-19 a la(s) 17 06 05 Captura de Pantalla 2022-08-19 a la(s) 17 05 22

itisnajim commented 1 year ago

sry for the late response, i'm in a vacation, make sure that the user is not a draft (published_at not null) and tokenpush not empty

Cosbiome commented 1 year ago

sry for the late response, i'm in a vacation, make sure that the user is not a draft (published_at not null) and tokenpush not empty Captura de Pantalla 2022-08-26 a la(s) 16 03 23 Captura de Pantalla 2022-08-26 a la(s) 16 03 41 Captura de Pantalla 2022-08-26 a la(s) 16 15 28 Captura de Pantalla 2022-08-26 a la(s) 16 21 16

Without any problem I hope you are enjoying your vacations, I already verified tokenpush is not null and up_user does not have a published_at system it keeps throwing me the same errors

itisnajim commented 1 year ago

i'm using postgres as a database, which database you selected ?

Cosbiome commented 1 year ago

MariaDB

l4red0 commented 1 year ago

@Cosbiome I have encountered the same problem, also using mysql. Apparently mysql/mariadb returns results in a different structure than postgres. I don't know what the original object from postgrest looks like but most likely mysql adds a second array.

I've changed all result.rows to results[0] in ./server/services/fcm-target.js(:78,84). This done the trick for me although it's obviously a quick fix.

@itisnajim Have a great vacations!

itisnajim commented 1 year ago

hello guys, @Cosbiome you can now update strapi-plugin-fcm to 1.0.4 and check, thanks to @l4red0 i did the fix he proposed without testing, i trust him xD i suggest to upgrade Strapi to >= 4.2.2 if not working! or/and re-comment here and i'll go more deep into the fixing issue.

jimodelid commented 1 year ago

My result seem to come up empty, no users to show, no topics to show even though I've got users and topics. I use the default installation so I presume it's sqlite? Running version 4.4.5 (latest). Are you able to assist?

hello guys, @Cosbiome you can now update strapi-plugin-fcm to 1.0.4 and check, thanks to @l4red0 i did the fix he proposed without testing, i trust him xD i suggest to upgrade Strapi to >= 4.2.2 if not working! or/and re-comment here and i'll go more deep into the fixing issue.

itisnajim commented 1 year ago

fixed https://github.com/itisnajim/strapi-plugin-fcm/pull/5