digitalcreations / customeriosharp Goto Github PK
View Code? Open in Web Editor NEWImplementation of Customer.io's write-only API for .NET.
Implementation of Customer.io's write-only API for .NET.
A new instance of HttpClient
is created with every CustomerIO
instance. I am concerned on HttpClient Socket Exhaustion. Do you have any opinion on this, please?
await _customerIo.Campaign(17)
.Where(broadcast => broadcast.InSegment(23))
.Where(broadcast => broadcast.Customer.Interest == "roadrunners")
.TriggerAsync(new { data = "foo" });
This would give us type safety (we already know what all the customer attributes are, but it would require adding a generic type argument to our entire class).
Everything in the API syntax, should be possible to implement using expression trees, but this may turn out to be a lot more work than required.
See:
Hello,
I'm trying to get CustomerIOSharp working within Unity 2018.1.9f2. I'm using Unity's .NET 4.x support, so everything should be working just fine. My code appears to be calling into the API correctly, but for some reason CustomerIO is not receiving either the events or the user property update. I am not catching any exceptions (though I'm fairly new to async in C# and may be making a mistake). Is there's something I'm missing here?
I've done some simple curl calls with my siteId and apiKey for sanity, and those work fine.
My wrapper looks like this:
public CustomerIOWrapper()
{
_customerIo = new CustomerIo(_siteId, _apiKey);
}
public Task UpdateUser(IAnalyticsEventReport report)
{
try
{
return _customerIo.IdentifyAsync(report.Dossier.ToCustomer());
}
catch (CustomerIoApiException e)
{
Dbg.WarningFormat("#customerio HTTP Response: {0}, Reason: {1}", e.HResult, e.Message);
return new Task(() => Dbg.WarningFormat("#customerio HTTP Response: {0}, Reason: {1}", e.HResult, e.Message));
}
}
private Task TrackEventAsync(string customerId, string eventName, IDictionary<string, object> data)
{
Dbg.LogFormat("#customerio #analytics CustomerIO customerId: {0}", customerId);
try
{
return _customerIo.TrackEventAsync(eventName, data, customerId: customerId);
}
catch (CustomerIoApiException e)
{
Dbg.WarningFormat("#customerio HTTP Response: {0}, Reason: {1}", e.HResult, e.Message);
return new Task(() => Dbg.WarningFormat("#customerio HTTP Response: {0}, Reason: {1}", e.HResult, e.Message));
}
}
Am I missing something stupid here?
Is there a better way I can log out the results from the HTTP call?
Please consider migration to PCL.
Here is a rough migration example alexshikov@7e1b459 though maybe you will have better solution.
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.