我正在尝试创建带有通知的应用.通知必须从php文件发送到Firebase,然后再发送到设备.起初,我尝试使用Firebase控制台进行发送,并且效果很好.但是,当我尝试使用php发送通知时,我遇到了问题.它说成功发送了,但是我没有收到任何通知.有我的PHP发送通知:<?php
function send_notification ($tokens, $message)
{$url = 'https://fcm.googleapis.com/fcm/send';$fields = array('to' => $tokens,'data' => $message);$headers = array('...
我想使用Firebase将通知推送到我的Ionic 2应用程序.我可以使用Firebase控制台直接推送通知,但是我想通过php文件发送通知.
当我发送邮件时,我收到来自PHP的响应:{“ message_id”:5718309985299480645}
并且电话中没有通知.
我已将this.fcm.subscribeToTopic(‘all’)放置在app.component.ts构造函数中.
我不知道我在做什么错..
this.fcm.subscribeToTopic(‘all’)是我应用中唯一与fcm相关的代码.
我的PHP代码:<?php $data = ar...
我正在尝试使用php通过Firebase的fcm服务发送通知.这是到目前为止我得到的:$ch = curl_init();
$payload = ['to' => '/topics/'.ANDROID_TOPIC,'notification' => ['message' => 1]
];
$headers = ['Content-Type: application/json','Content-length: '.sizeof(json_encode($payload)),'Authorization: key='.FIREBASE_KEY
];curl_setopt($ch, CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');
curl_setopt($ch, CU...
我正在尝试使用PHP和Google API将数据推送到Firestore数据库.
在我在网上看到的文档和示例中,我能够在发送数据时使用mapValue和arrayValue.
我使用的示例如下:["orderName" => ["stringValue" => "Gbeila Aliu Wahab"],"orderLocationName" => ["stringValue" => "Accra Mall Limited"],"orderTotalAmount" => ["doubleValue" => 150.5],"orderDescription" => ["stringValue" => "Lorem Ipsum is simply dummy text of the print...
我正在尝试使用Firebase云消息传递系统从服务器向我的android设备发送推送通知.我能够成功注册我的设备,并且也为我的设备生成了令牌.我无法使用以下脚本将通知发送到我的设备<?phpfunction send_notification($token1,$message)
{$url = 'https://fcm.googleapis.com/fcm/send';$fields = array('registration_ids'=>$token1,'data'=>$message);$header = array('Authorization:key = <my key here>','Content-Type: application/j...
我有一个PHP后端和一个Android客户端.使用客户端,用户可以通过Firebase使用Google或Facebook登录到我的应用程序.我从FirebaseUser获得令牌并将其发送到我的服务器.显而易见的是,第一部分(标头)包含算法(RS256),第二部分(有效负载)具有所有与用户相关的数据.第三部分是前两个部分的签名,以便在我的后端进行验证.问题是,我不知道该怎么做.更具体地说是什么.
我使用JWT.io来检查我的令牌,并尝试通过运气来验证它.由于使用的算法是RS25...
到目前为止,我已经知道Firebase的Security Rules在确保数据安全(无论使用何种平台)方面都发挥着重要作用.但是我发现,如果开发人员以易于在客户端脚本上看到Firebase凭证的方式来构造Web JavaScript组合和其他实现,则它们可能完全处于风险之中.
值得庆幸的是,Firebase以多种语言支持REST API’s,从而可以某种方式减轻风险.为此,我查看了我要创建的Web数据管理门户网站的Kreait’s Firebase Admin SDK for PHP.
这是Firebase Admin S...
昨天我们开始遇到REST API问题,尤其是刷新令牌方法:https://firebase.google.com/docs/reference/rest/auth/#section-refresh-tokencurl 'https://securetoken.googleapis.com/v1/token?key=[API_KEY]' -H 'Content-Type: application/x-www-form-urlencoded' --data 'grant_type=refresh_token&refresh_token=[REFRESH_TOKEN]'我们使用文档上的curl示例和我们自己的开发(使用PHP和Guzzle)尝试了这个调用,我们总是得到这个错误:"...
是否有用于将php连接到Firebase Firestore数据库的PHP库?PHP甚至可以从Firebase检索数据吗?解决方法:是的,现在有一个PHP client library.use Google\Cloud\Firestore\FirestoreClient;$db = new FirestoreClient();$citiesRef = $db->collection('cities');
$query = $citiesRef->where('state', '=', 'CA');
$snapshot = $query->documents();
foreach ($snapshot as $document) {printf('Document %s returned by query state=...
我想在我的Serverside(php)中将推送通知中的图像和图标发送到我的应用程序.
我在Google上搜索过但无法获得正确的结果.我得到FCM PHP Code.我使用这些代码发送通知,但是当我使用“图像和图标”参数图像时,通知中没有收到.
在GCM中,可以轻松地在推送通知中发送图标和图像$fields = array('registration_ids' => $registrationIDs,'data' => array("title" => "SamplePush Application","style" => "inbox"; //picture/inbox,"message...
我使用PHP使用Firebase API并使用JSON格式发送帖子数据.响应是给我message_id但消息未送达.
当我使用Firebase控制台而不是具有相同字段的API时,它已成功传递.
我的PHP代码:<?php$json_data = '{ "data": { "title": "Hey you got a message","text": "Hi from firebase api"},"to": "/topics/all","priority": "high"}';$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');
curl_setopt($...
我正在尝试使用PHP,Google Auth library以及Firebase的REST的wrapper从服务器访问Firebase …这很有助于实现这一点:use Firebase\JWT\JWT;
use Google\Auth\Credentials\ServiceAccountCredentials;
use Google\Auth\HttpHandler\HttpHandlerFactory;
use GuzzleHttp\Client;$email = 'account@email.com';
$key = 'private_key_goes_here';$scopes = ['https://www.googleapis.com/auth/userinfo.email','https://www.googleapis...
我对开发很陌生,在这个主题上找不到很多端到端的支持.我使用firebase帮助页面做了我能做的事情.我无法在我的ios设备上收到通知,但FCM在android上完美运行.这是我从xcode的appdelegateimport UIKit
import Firebase
import FirebaseMessaging
import UserNotifications@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {var window: UIWindow?func application(_ appl...
我的任务是为基于firebase的Android应用构建一个Web界面.我有一些与数据库交互的端点(云功能).要访问这些端点,我需要使用电子邮件和密码[1]对用户进行身份验证,检索accessToken [2]并使用Authorization:Bearer {accessToken}标头授权对端点的每个请求.
我使用php并努力思考如何在我的应用程序中管理经过身份验证的用户.
TL; DR请在php中查看我的最终解决方案. https://stackoverflow.com/a/52119600/814031
我在php会话中通过ajax...
为了在PHP中使用HTTP V1 API(而不是遗留API),必须使用REST接口.
https://firebase.google.com/docs/cloud-messaging/send-message#top_of_page
我想知道如何获得Auth 2.0访问令牌?
https://firebase.google.com/docs/cloud-messaging/auth-server
由于没有适用于PHP的Google API客户端库(请参阅上面链接中的示例),如何通过REST调用接收Auth 2.0令牌(无需显示PHP代码)?
相关问题:一旦收到这个短生命令牌,如何刷新此令牌?什么是工...