Tag: firebase云消息传递

邮递员 – Firebase通知ios

我试图发送POST到火力发电邮,但我有一个错误: <HTML> <HEAD> <TITLE>Unauthorized</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1>Unauthorized</H1> <H2>Error 401</H2> </BODY> </HTML> 这是我的身体和头。 对于授权,我不确定,我把我的IOS的Firebase项目的API服务器密钥。 我想发送它,并在我的设备上显示通知。 感谢您的帮助。 当我用xcode启动应用程序时,我得到了APNS的错误,但最终:连接到FCM。 <FIRAnalytics/INFO> Firebase Analytics v.3200000 started 2016-08-25 07:58:06.690 HelloCordova[2426:] <FIRAnalytics/INFO> To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled 2016-08-25 07:58:06.741 HelloCordova[2426:671139] Firebase Crash Reporting: Successfully enabled 2016-08-25 07:58:06.754: <FIRInstanceID/WARNING> FIRInstanceID AppDelegate proxy enabled, will swizzle app […]

当应用在后台运行时,Google Firebase远程通知不会popup

我正在使用Google Firebase向用户发送通知。 当时我试图发送通知单个设备(我的)。 遇到接收通知问题 – 而我的应用程序运行在后台横幅不会出现。 但是,如果我打开我的应用程序,方法didReceiveRemoteNotification:触发我的警报视图: – (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:userInfo[@"notification"][@"body"] message:@"More info…" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Open",nil]; [alert show]; } 但是,由于它是用Google Firebase文档编写的,因此在打开应用程序后会触发此方法,所以这是有道理的。 所以消息被传递到我的设备,我只是不能触发通知横幅,如果应用程序在后台。 我读了有关设置消息优先级为高和自定义数据密钥的内容 – 可用1,但没有运气。 我是否在代码中缺less其他内容来触发通知? 我已经使用Google Firebase指南来实现通知。

(lldb)与Firebase的错误

每当我点击一个特定的标签,我得到一个lldb错误。 该选项卡被称为帐户,它应该从一个名为“请求”的子节点拉数据,并显示在列表(表视图控制器)的数据。 我以前多次做过这个。 我甚至使用自己的回收代码来完成这个任务,但是错误一直在显示。 我已经确保每个button/标签都连接到视图控制器,并确保没有断开连接。 错误消息是说我的请求对象不符合密钥代码,但事实并非如此。 还有什么呢? 这是代码和一些截图: 这是我正在使用的方法。 只有当我调用这个函数时才会出现这个错误。 除此之外,屏幕只是空白,所以我认为这个问题必须在function内。 顺便说一句,requestsArray是一个声明为这样的请求数组: var requestsArray = [requests]() 下面是来自该视图控制器的其余代码: 编辑

Firebase:从未知的孩子中检索嵌套的数据

我有这样的firebase结构 "broadcast": { "ghjghjFc1S3KO0y8yJwORdfgret": { //user ID "ryrtybgzMiI858YyGua": { //broadcast ID "a": "xxx", // broadcast Detail "b": "yyy", "c": false } "cbvbcvbMvAnSDqTb15vU": { //broadcast ID "a": "xxx", // broadcast Detail "b": "yyy", "c": true } } "3uqWZJRFc1S3KO0y8yJwORTMtWC2": { //user ID "jkhjkbgzMiI858YyGua": { //broadcast ID "a": "xxx", // broadcast Detail "b": "yyy", "c": false } "qwwerqweMvAnSDqTb15vU": […]

使用用户名而不是电子邮件进入ios应用程序和firebase

这是我的情况,我正在使用的Firebase作为一个iOS应用程序的数据库。 用户可以通过电子邮件login: @IBAction func signInButtonPressed(_ sender: UIButton) { if let email = emailField.text, let password = passwordField.text { FIRAuth.auth()?.signIn(withEmail: email, password: password) { (user, error) in if let error = error { let alertController = UIAlertController(title: "Login or password incorrect", message: "", preferredStyle: UIAlertControllerStyle.alert) alertController.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default,handler: nil)) self.present(alertController, animated: true, completion: nil) } […]

iOS FCM没有得到推送通知

由于我更新到迅速3,FCM不起作用。 在Capabilities中启用Push Notifications ,并在Firebase控制台上更新证书。 顺便说一下,在Android应用程序的fcm工作得很好,它在ios上工作,但在swift 3和新的firebase库更新后,它不。 AppDelegate.swift: class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? let notificationCenter = NotificationCenter.default var connectedToFcm: Bool = false func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { let settings: UIUserNotificationSettings = UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil) application.registerUserNotificationSettings(settings) application.registerForRemoteNotifications() FIRApp.configure() NotificationCenter.default.addObserver(self, selector: #selector(self.tokenRefreshNotification), name: NSNotification.Name.firInstanceIDTokenRefresh, object: nil) […]

无法构build模块Firebase

我一直在尝试将Firebase分析连接到Objective C / Swift项目中。 我已经按照说明正确。 我的searchpath已设置。 我的链接器标志设置为-ObjC。 我可以让项目正确编译。 一旦我@import Firebase和构build,我得到一个错误,说不能构buildFirebase模块。 当我查看日志时,发现构buildFirebase分析和Firebase Core存在parsing问题。 我已经把这个连接到另外三个项目中,没有使用cocoa豆荚。 请指教。

iOS空的Firebase推送通知不显示

iOS上的Firebase通知存在一个奇怪的问题。 它完美的工作,但唯一的问题是,如果我保持服务器上的“身体”参数为空,它会播放应用程序中的通知声音,但不显示任何内容。 同样的东西在Android上显示通知。 我遇到了某种苹果安全吗? 如果我只在“body”中添加一个空的空格,那么它将显示出来,但没有它。 如果任何机构可以build议我什么请。 我的服务器端代码 $msg = array ( 'title' => '', 'body' => ' ', 'click_action' => '.InstagramLoader', 'icon' => 'myicon',/*Default Icon*/ 'sound' => 'mySound'/*Default sound*/ ); $data = array( 'text' => $title, 'img_url' => $img_url ); $fields = array ( 'to' => $registrationIds, 'notification' => $msg, 'data' => $data ); $headers […]

TableView图像直到滚动才加载

我正在使用Firebase将我的图片加载到我的单元格的ImageView ! 有一个问题。 我正在使用caching机制来防止可重复reusable cells格加载时重新下载图像,但图像不加载,直到我滚动我的TableView 。 这是代码; public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cell") as! TableViewCell cell.imgv.image = nil if let urlString = self.filteredFlats[indexPath.row].flatThumbnailImage?.imageDownloadURL { imageURLString = urlString let url = URL(string: urlString) if let imagefromCache = imageCache.object(forKey: urlString as AnyObject) as? UIImage { DispatchQueue.main.async { […]

与Firestore崩溃

当我查询一个不存在的文档的集合时,我仍然返回一个非零对象,当我尝试调用documentSnapshot?.data()时崩溃。 返回的错误是"Document '<FSTDocumentKey: XXXXXX>' doesn't exist. Check document.exists to make sure the document exists before calling document.data.'"