shawnspeak / stream-net Goto Github PK
View Code? Open in Web Editor NEW.NET client for http://getstream.io
License: MIT License
.NET client for http://getstream.io
License: MIT License
GetStream recommends switching api clients to their new endpoints:
https://us-east-api.stream-io-api.com/api/v1.0/
https://us-west-api.stream-io-api.com/api/v1.0/
https://eu-central-api.stream-io-api.com/api/v1.0/
https://getstream.io/blog/stop-using-io-domain-names-for-production-traffic/
Any chance we could do this? Or are you accepting PRs?
Hi Shawn,
Great stuff with your steam-net client.
Hope your having a great day.
Couple questions:
Activities with non YouTube videos:
To do an activity and share a video that is not on YouTube, using yourstream-net client.
GetStreamIo has the following example posted for sharing YouTube videos:
addActivity({actor: 'eric', verb: 'watch', object: 1, youtube_id: 'z_AbfPXTKms'}
But what if the video is not on YouTube and say the video resides some where else. What if we want that activity to show an image of the video but have the image link to the video url.
How would add that activity using your stream-net client?
Activities with sharing pictures:
We want to do an activity that shares a picture, using stream-net client.
How do we do that?
Thank you for your time in reading this message and the time it takes to create the detailed response.
Have a great day and great weekend.
Regards,
Patrick Rosenberg
When calling StreamFeed.Following with no parameters, I'm getting the following exception:
Newtonsoft.Json.JsonSerializationException: 'Error converting value {null} to type 'System.DateTime'. Path 'results[0].updated_at', line 1, position 232.'
Looking at the response from GetStream, it looks like updated_at is null:
{
"feed_id": "user:aggregate-dev-2942a2fa-fa7a-46b1-b11a-229ee95f8818-aggregate2",
"target_id": "user:c1de77da-b521-4af6-9589-7498c66b163d",
"created_at": "2017-12-12T19:57:49.768087Z",
"updated_at": null
}
This same code seemed to work not long ago (a month maybe?). Do you know if something in the GetStream api changed recently?
Hi,
I am using https://github.com/shawnspeak/stream-net c# library
How can I get single users aggregated feed using this library?
How to get likes and comments of a single activity?
If I use this library's GetActivities function it returns like and comment within feed, but what I need is likes and comments on that activity.
Hi!
Can you enlighten me with working with AddActivity please? I'm using VB and would like to know how can include other data like "tweet" and all other contents.
Thanks in advance!
Dim actlike = New Activity("Alex", "comment", "post:4b93b75c-378e-11e8-9926-128899f22c76") With {
.ForeignId = "comment:2979ad56-377e-11e8-9696-0ad650757e1c",
.Time = Now.ToUniversalTime,
.To = {"notification:eric"}
}
The getstream.io API supports a keep_history parameter for the Unfollows API call - this allows for unfollowing a feed without removing all of the activities that have already been added from the followed feed. This issue is to add support for keep_history in stream-net.
Hi, Shawn,
I hope you don't mind, since I am new to social feeds and following stuff. I have some more questions.
Can you show me a syntax example on how to do an activity, to post a message TO someone else?
Similar to the below code, but using your stream-net client:
// specifying additional feeds to push the activity to using the to param
// especially usefull for notification style feeds
to = ['user:2', 'user:3'];
activity = {'to': to, 'actor': 1, 'verb': 'tweet', 'object': 1, 'foreign_id': 'tweet:1'};
The reason I am asking, is we want to have user 1 go to user 2's feed and post a message.
When that happens we want user 1's feed to receive the post, so all user 1's followers see it and we want it to show up in user 2's feed and have all user 2's followers see it.
Can we accomplish that with the TO functionality?
AppVeyor build is hanging due to the install script added for installation of NUnit 3.0. AppVeyor has added support for NUnit 3.0 and this install script is breaking the build.
one user reported an issue related to how activities are serialized to JSON. It seems like in their case that a variable with type Double (1) gets serialized to JSON as the string "1".
I recently transfered all the calls with stream-net to Azure Functions (Queue triggers). With version 1.3.2 everything worked like a charm, however when updating the nuget package to 2.0.1 in order to use the new api points I get this message:
The request was aborted: Could not create SSL/TLS secure channel.
at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
The funny thing is, if I run a small project locally to use AddActivity, everything goes well.
If I use ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; just before I call StreamClient GetStreamsClient = new StreamClient("xxx","xxx"); it does work.
So a heads up to developers running into this issue with azure functions & stream-net.
Ps great stuff Shawn!
Currently the stream options only support us east, can you include the other regions like north east Asia?
Hi Shawn, I saw that you accepted my pull request and update nuget, but when I update my nuget package, the apilocation still only have one location
Shawn,
Hope your doing well.
Question:
Are there plans to make stream-net ASP.NET Core 1.0 compatible?
StreamClient is currently a bottleneck in unit testing. Can you consider making the public methods of the following classes virtual, or Extract interfaces for all public methods?
Here's the link to enrichment in their documentation for those who are unaware.
With the recent articles regarding the state of HttpClient and abusing disposable on it, I was taking a look at the source. I would like to suggest to implement a static reference for the HttpClient combined with the lazy property. With stream-net always having the same base address, no modifications for the headers it seems to me this is a perfect situation where not to dispose the HttpClient in order to improve performance of socket reuse. Now that I moved al the stream-net calls to azure functions I like to limit the duration times of said functions. Recreating the HttpClientis very time consuming and performance suffers from this.
I would be happy to add a pull request if you're open to it.
Ref:
https://docs.microsoft.com/en-us/azure/architecture/antipatterns/improper-instantiation/
https://contrivedexample.com/2017/07/01/using-httpclient-as-it-was-intended-because-youre-not/
Edit, just noticed ServicePointManager.FindServicePoint(GetBaseUrl()).ConnectionLeaseTimeout =is not possible in .NetCore. According to https://github.com/dotnet/corefx/issues/11224 solution could be refreshing the client every hour in case a DNS change has happened, as shown in the url.
If an exception occurs during a getstream.io request, but it is not an exception that results in a getstream.io exception response - for example, if the request to getstream.io times out, then stream-net throws a NullReferenceException because it attempts to get the exception state from the empty response.
Note: I am going to submit a pull request for the fix today.
Hello, wondering if anyone has tried using this in Unity Editor and knows how to make it work. I got the code to compile, but has a runtime error within Unity
Able to add custom fields value to api, but unable to get custom fields value from api. I am very new getstream, is there any doc that can help me. Is this available in paid version?
Hi there,
I am Tommaso CTO of getstream.io. Awesome that you built a .net API client! Are you already using the client on your application? Feel free to ping on [email protected] to talk about the client ;)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.