我正在尝试通过FCM向我的Web应用发送消息。不幸的是,我收到以下错误消息,我无法独自解决...
通过POSTMAN我收到了JSON:
{
"multicast_id": 7441926471010389687,
"success": 0,
"failure": 1,
"canonical_ids": 0,
"results": [
{
"error": "NotRegistered"
}
]
}
Run Code Online (Sandbox Code Playgroud)
这是我仅有的错误消息。请参阅我发送给FCM的以下POSTMAN配置POST消息
有人已经面临过同样的问题吗?我找不到任何解决办法来解决我在互联网上的问题...
另请参见下面的Firebase.java
package com.inovans.backend.web.rest.firebase;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
import javax.annotation.PostConstruct;
import org.springframework.stereotype.Service;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;
import com.google.firebase.messaging.FirebaseMessaging;
import com.google.firebase.messaging.Message;
@Service
public class Firebase {
@PostConstruct
void initialierMyFirebase() {
this.initializeFirebase();
}
private void initializeFirebase() {
// if(this.firebaseApp.getApps().isEmpty()) {
FileInputStream serviceAccount = null;
try {
serviceAccount = new FileInputStream(
"src/main/java/com/inovans/backend/web/rest/firebase/emergency-manager-57773-firebase-adminsdk-x4p6o-c2ea07c8f4.json");
} catch (FileNotFoundException e) { …Run Code Online (Sandbox Code Playgroud)