最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

firebase - Minimum APIs for Android Application to receive FCM notifications - Stack Overflow

matteradmin7PV0评论

At my company we are trying to restrict our Google API keys (the ones Firebase creates for you) to the minimum required to handle our FCM notifications. We only use direct to device notifications, no topics of any kind. In small scale test this seems to only have required the Firebase Installations API.

This allows us to retrieve a token for the device from the API Call:

val firebaseMessaging = FirebaseMessaging.getInstance()

firebaseMessaging.token

This token alone lets us send a FCM notification from our server-side solution.

The imports in our Android app are:

com.google.firebase.messaging.FirebaseMessaging
com.google.firebase.messaging.RemoteMessage
com.google.firebase.messaging.FirebaseMessagingService

with a dependency on:

com.google.firebase:firebase-messaging:23.1.2

Is there anything I am missing here or other APIs that we should be including? Any help would be appreciated. I am limited to how much source code I can share.

Post a comment

comment list (0)

  1. No comments so far