首页 > 解决方案 > Receiving FCM (GCM) behind proxy on Android

问题描述

We have an app that uses FCM (ex GCM) for push messaging and notification on Android devices.

We have an use case where the app won't have open access to Google Play Services as it will be deployed on a corporate network - well it is a "everything closed except fixed servers with fixed IP addresses and ports" firewall. Direct connection to these services will not be allowed, but we can provide our own http/s or socks proxy to access whatever we want.

To my latest knowledge and searches on SO, even if you specify a proxy on android, the proxy will only be used if your app is set up to use it (no problem), but Google Play Services and Firebase will just ignore the proxy setting.

Has this changed? Can Firebase/FCM/Google play services run through the proxy specified in Android? And if so, from which android version?

Thank you, Nicolas

标签: androidfirebasefirebase-cloud-messaginggoogle-cloud-messaginggoogle-play-services

解决方案


这是来自 firebase 支持的最新信息(简短回答:否)

" 不幸的是,Firebase 云消息传递目前并未设计为支持代理,并且不会尝试解决所有网络状况。另一种方法是将 FCM 列入白名单,根本不通过代理。您应该将 IPv4 中的所有 IP 地址列入白名单和 IPv6 块在 Google 的 ASN 15169 中列出。有关 FCM 端口的更多信息,请参阅此文档。 https://firebase.google.com/docs/cloud-messaging/concept-options#ports_and_your_firewall "

如果有人有解决方法的想法,请随时分享:) 谢谢,尼古拉斯


推荐阅读