我正致力于实现出现在防火墙文档更改中的推送通知。我在使用反应-本机-火基模块。我的google云功能监听对消防局的更改,然后通过firebase-admin发送消息。
google的参考文件说,您可以指定一个设备来发送消息:
// This registration token comes from the client FCM SDKs.
var registrationToken = 'YOUR_REGISTRATION_TOKEN';
var message = {
data: {
score: '850',
time: '2
如何在Firebase云消息中将令牌发送到服务器。我尝试过以下代码:
public void onTokenRefresh() {
// Get updated InstanceID token.
String refreshedToken = FirebaseInstanceId.getInstance().getToken();
Log.d(TAG, "Refreshed token: " + refreshedToken);
// TODO: Implement this method to send any registration to your app's
问题是,我想在我的聊天应用中使用Firebase云消息。在我的android studio中实现firebase文档时,我需要创建一个扩展FirebaseInstanceIdService的类。然而,这项服务似乎缺失了。
public class MyFirebaseInstanceIdService extends FirebaseInstanceIdService{
}
结合admin使用新的Firebase函数。
我想使用admin.auth().createCustomToken()函数。调用此函数将导致错误消息。
Error: createCustomToken() requires a certificate with "private_key" set.
at FirebaseAuthError.Error (native)
at FirebaseAuthError.FirebaseError [as constructor] (/user_code/node_modules/firebase-admin/lib/ut
我已经在Codeigniter中构建了web版本,并一直在使用react Native的移动版本。为了发出新订单通知,我将使用firebase云化消息。如何,在哪里可以获得此设备令牌? public function sendFCMNotification($registration_ids, $message){
$SERVER_API_KEY ='my server api key';
// payload data, it will vary according to requirement
$data = [