草庐IT

notification-listener

全部标签

search - Flutter Firestore Query Listen - 无法引用 Listen 中的变量

我有一个查询来查找指定条形码的文档ID:FuturefindBarcode()async{StringsearchBarcode=awaitBarcodeScanner.scan();Firestore.instance.collection('${newUser.userLocation}').where('barcode',isEqualTo:'${searchBarcode}').snapshots().listen((data){StringidOfBarcodeValue=data.documents[0].documentID;print(idOfBarcodeValue)

ios - 错误状态 : Stream has already been listened to Flutter error

我正在调用一个api。发送请求后,我收到了流式响应。但我无法解析响应并将其转换为字符串/JSON。这是我调用api的地方。staticFuturecallDeviceListFetchApi()async{Completercompleter=newCompleter();StringjsonResponse;Stringurl=Constants.BASE_URL+Constants.DEVICE_REGISTER_URL;varclient=newhttp.Client();varrequest=newhttp.Request('GET',Uri.parse(url));reque

flutter - 在 myCtrl.stream.listen 中调用 myCtrl.sink.addError 时出错

我是Bloc模式和Stream的新手。在创建Bloc时,我得到了以下日志:E/flutter(18086):[ERROR:flutter/lib/ui/ui_dart_state.cc(148)]UnhandledException:ssE/flutter(18086):null你可以复制这个import'dart:async';import'package:flutter/material.dart';voidmain()=>runApp(newMyApp());classMyAppextendsStatelessWidget{@overrideWidgetbuild(BuildCo

android-studio - Flutter:我尝试在将 flutter_local_notification 添加到依赖项之后构建一个项目,但它失败了

错误:失败:构建失败,出现异常。*什么地方出了错:任务“:app:processDebugResources”执行失败。Androidresourcelinkingfailed/home/saugo/.gradle/caches/transforms-1/files-1.1/design-27.1.0.aar/9fb468d34634c53fd038a8410ad263e8/res/values/values.xml:96:5-202:AAPT:error:resourceandroid:attr/fontVariationSettingsnotfound./home/saugo/.g

android - 方法 'listen' 没有为类 'Function' 定义?

大家好,我正在尝试构建一个flutter来显示纬度和经度,但我仍然在代码中遇到错误:voidinitState(){super.initState();//Defaultvariableset0currentLocation['latitude']=0.0;currentLocation['longtitude']=0.0;initPlatformState();locationSubscription=location.onLocationChanged.listen((Mapresult){setState((){currentLocation=result;});});}

node.js - Redis on message listener 触发了两次

我正在使用NodeJS和Redis开发聊天应用程序,为什么我使用Redis订阅,因为我需要在用户登录时通知其他用户,当用户第一次登录时我的问题就开始了它工作正常onmessagelistener调用了一次,但是当同一个用户刷新页面时,发现publish方法被调用了两次。这是我使用的代码示例:varredisClient=redis.createClient({auth_pass:password});varmyServer;myServer=require('http').createServer(app);varsocketIo=require('socket.io').listen

python - Tornado -redis : Why the 'listen' and the 'brpop' of tornado-redis can't work at the same time

代码如下:fromtornadoredisimportClientfromtornado.ioloopimportIOLoopfromtornado.genimportcoroutine,Taskrds=Client()@coroutinedeflisten_pub():defhandle(msg):printmsgyieldTask(rds.subscribe,channels='pub')rds.listen(handle)@coroutinedeflisten_list():whileTrue:res=yieldTask(rds.brpop,keys='list')printre

python - redis python psubscribe 事件回调,不调用.listen()

我正在尝试使用python订阅redis中的键空间事件。我希望在调用.psubscribe()后不要将for循环与.listen()一起使用。这可能吗?我已使用KEA启用所有键空间事件。defsubscribe(self,key,handler):#thisfunctionnevergetscalled,ifIdon'taddthefor-loopwithlisten()belowdefevent_handler(msg):print('Handler',msg)redis_server=StrictRedis(host='localhost',port=6379,db=0)pubsu

xcode - 如何避免此错误 : "Took too long to show custom notification. Falling back to static."?

在AppleWatch模拟器上测试自定义长看通知时遇到问题。调试器记录此错误:WatchKitExtension[5230:156324]Tooktoolongtoshowcustomnotification.Fallingbacktostatic.如何解决这个问题? 最佳答案 我在使用Xcode设置的默认代码时遇到了这个问题。我在didReceiveRemoteNotification里面没有做任何操作,还是报错。原来失败的原因是我的WKUserNotificationInterfaceController子类没有连接到我的Sto

objective-c - swift 2 : no delegate callbacks for push notifications as opposed to objective-c

我已经创建了2个示例(单一View)项目来测试推送通知,除了如下通知设置代码外,我没有添加任何代码:项目1(Swift2):funcapplication(application:UIApplication,didFinishLaunchingWithOptionslaunchOptions:[NSObject:AnyObject]?)->Bool{letsettings=UIUserNotificationSettings(forTypes:[.Alert,.Badge,.Sound],categories:nil)UIApplication.sharedApplication().