Questions tagged [subscribe]

994 questions
5
votes
1 answer

FCM: How to avoid duplicate notifications if a user has subscribed to multiple topics

Say User A has subscribed to Topics T1, T2 and T3. If I send same notification to Topics T1 and T3. Will A receives two notifications ? If So, how to avoid this duplicate notifications ? Thanks
5
votes
2 answers

How to avoid duplication of event subscription?

I have 3 classes namely Login, Barcode, and the Main. Login class just contains the authentication of the users. Barcode class has the following snippet code: class Barcode { public delegate void BarcodeReadHandler(object sender,…
banana
  • 145
  • 6
5
votes
2 answers

IObservable.Add vs. IObservable.Subscribe

What is the difference between these two methods, and what is the best situation for each? I know they are both able to attach a function for handling emissions from an IObservable, but I don't really understand the differences beyond…
user3685285
  • 6,066
  • 13
  • 54
  • 95
5
votes
2 answers

How can i change value of observable inside of subscribe function?

How can i change value of observable inside of subscribe function? For example JS Model: function Model(){ self = this; self.Test = ko.observable(2); self.Test.subscribe(function (){ if (/**Some bool expression**/) { …
k0lpak
  • 555
  • 4
  • 18
5
votes
2 answers

Bind two observables in knockout.js

I have two simple observables, for example, val1 = ko.observable("input1"); val2 = ko.observable("input2"); and I want them to act like one, so when one of them changes, the other changes as well. I know that in common case it's better to use…
Kasheftin
  • 7,509
  • 11
  • 41
  • 68
4
votes
1 answer

How can two Components subscribe to the same Event?

I have a Client service with an array "messages" that contains server messages. Then I have a component that subscribes to that array and checks every new message for its subject. Like this: client.messages.subscribe(msg => { switch (msg.SUBJECT) …
sanitizedUser
  • 1,723
  • 3
  • 18
  • 33
4
votes
3 answers

How can I programmatically subscribe to all the events of an object?

I am trying to subscribe to ALL events exposed by a WPF GridView-like 3rd party component in order to do some debugging. Aside from the suggestion that this might not be the best way to go about debugging it and stuff like that I would like to know…
Andrei Rînea
  • 20,288
  • 17
  • 117
  • 166
4
votes
1 answer

Why am I getting "Subscribe is not a function" error?

I have a component that allows a user to select an option from the port list. Once they've made the selection, they click "Connect Port" button. this calls a service to store the selected port so that it can be stored as a string. I am getting…
Clayton Allen
  • 239
  • 3
  • 15
4
votes
4 answers

Angular 5 Subscribe not a function

Angular return a error : Error: Uncaught (in promise): TypeError: res.users.subscribe is not a function. Since this morning, I don't understand what's wrong in my resolve. UserService.ts import { Injectable } from '@angular/core'; import {…
Reuno92
  • 57
  • 1
  • 1
  • 7
4
votes
1 answer

Chaining continuations together using .NET Reactive

Newbie Rx question. I want to write a method like the following: public IObsevable Save(object obj) { var saveFunc = Observable.FromAsyncPattern(...); saveFunc(obj).Subscribe(result => { Process(result); return…
Brian Berns
  • 15,499
  • 2
  • 30
  • 40
4
votes
2 answers

can't seem to use 'first()' on Observable(rxjs in Angular)

I read about this awesome feature in RXJS which would theoretically allow me to subscribe only for one response, but can't seem to implement it. Instead, I'm getting this error, "Property 'first' does not exist on type 'Observable'." although I am…
Efim Rozovsky
  • 363
  • 3
  • 11
4
votes
1 answer

Processing a received message using paho mqtt in python

import paho.mqtt.client as mqtt def on_connect(client, userdata, flags, rc): print("Connected with result code "+str(rc)) client.subscribe("/leds/pi") def on_message(client, userdata, msg): if msg.topic == '/leds/pi': …
Swishonary
  • 93
  • 1
  • 6
4
votes
2 answers

FCM - Send to topics and "Not Registered" error

I developed an Android app that subscribes to a topic (subscribeToTopic() in OnCreate of main activity) and then receives notifications sent by my server to that topic. The problem is that, from time to time, someone complains that notifications…
4
votes
1 answer

subscribe in Angular 2

I want my ngOnInit function do next things: - make http request for some data using this.structureRequest.sendRequest(),which works fine, and after data have been received to start view it using this.viewNodes() function. I use subscribe , but it…
Serhiy
  • 1,893
  • 9
  • 30
  • 48
4
votes
2 answers

Is there any subscription payment api in android ,user has to pay every two months , in order to access app service?

I have developed an application , where it provide some services to user. he has to subscribe before for 2 months , 4 months like that , he can update it by paying . Can any one tell me , is there any api provided to serve the above purpose . ??…
Srinivas
  • 1,688
  • 8
  • 30
  • 51