Bug: unable to use fcm push
Sylariam opened this issue · 4 comments
What happened?
I am trying to explore the Push feature of the OpenIM server(using android demo app). I noticed that the configuration options include FCM. However, the documentation on how to use FCM is somewhat unclear.
config:
The format for push.fcm.serviceAccount is "x.json," so I assume this should be a JSON file. Initially, I placed the JSON file in the root directory of the Helm charts. It DID NOT work.
I replaced the Helm image repository with my own packaged image and added some logs during startup. The logs indicate that the push service did not correctly read push.fcm.serviceAccount. Then I realized that helm did not specify serviceAccount during the Helm install. Certainly, there isn't that file inside the container either.
So, how should I fix it?
What did you expect to happen?
The FCM client initialized properly, and offline push notifications could be sent.
How can we reproduce it (as minimally and precisely as possible)?
in config-imserver.yaml, change push.enable to fcm
Anything else we need to know?
No response
version
Cloud provider
OS version
Install tools
Hi @Sylariam,
Thank you for reaching out to us regarding the issue you encountered with OpenIM's FCM push feature.
Based on your description, it seems that the push service did not correctly read push.fcm.serviceAccount
, and you realized that helm did not specify serviceAccount during the Helm install.
To fix this issue, you can try the following steps:
- Create a Kubernetes secret using your FCM service account JSON file:
kubectl create secret generic fcm-secret --from-file=serviceAccount.json=<path/to/your/serviceAccount.json>
- In your
config-imserver.yaml
, specify thepush.fcm.serviceAccount
as the path to your FCM service account JSON file inside the container:
push:
enable: fcm
fcm:
serviceAccount: /path/to/serviceAccount.json
- When installing Helm, specify the
--set serviceAccount.create=true
flag to create a service account for your Helm chart:
helm install my-openim-chart openim-chart --set serviceAccount.create=true
Please let us know if this solution works for you. If you have any further questions, feel free to ask.
I don't think this has anything to do with k8s service account... or has it?
I don't think this has anything to do with k8s service account... or has it?
Due to the presence of config-imserver.yaml, I assumed that specifying a similar method during helm install to use a configuration file would be sufficient. Why go through the extensive process of using Kubernetes secrets and service accounts?