Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: issue in direct messages using streaming api

$
0
0
Hi,

Yes, the event is not getting fired inside the function. I did put a breakpoint over there but the event is not fired.
private static void Stream_UserStreamExample()
        {
            var userStream = Stream.CreateUserStream();


            // Messages
            EventsRelatedWithMessages(userStream);    //I am using my application for Messages.

            // User Update
            userStream.LoggedUserProfileUpdated += (sender, args) =>
            {
                var newLoggedUser = args.LoggedUser;
                Console.WriteLine("Logged user '{0}' has been updated!", newLoggedUser.Name);
            };

            // Friends the stream will analyze - A UserStream cannot analyze more than 10.000 people at the same time
            userStream.FriendIdsReceived += (sender, args) =>
            {
                var friendIds = args.Value;
                Console.WriteLine(friendIds.Count());
            };

            // Access Revoked
            userStream.AccessRevoked += (sender, args) =>
            {
                Console.WriteLine("Application {0} had its access revoked!", args.Info.ApplicationName);
            };

            userStream.StartStream();
        }


        private static void EventsRelatedWithMessages(IUserStream userStream)
        {


            //These events didn't get fired when I send/receive Direct Messages.

            userStream.MessageSent += (sender, args) => { Console.WriteLine("message '{0}' sent", args.Message.Text); };
            userStream.MessageReceived += (sender, args) => { Console.WriteLine("message '{0}' received", args.Message.Text); };
        }
Thanks

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>