ServiceStack Client on Xamarin.Mac (not iOS) - servicestack

I have a Xamarin.Mac Unified API project with ServiceStack Client v4.0.38. I get the good old "System.ArgumentException: PclExport.Instance needs to be initialized" when trying to instantiate JsonServiceClient.
If I was on iOS, I would call IosPclExportClient.Configure() and life would be good. However, I can't find the equivalent for Mac. I would expect something like MacPclExportClient.Configure().
Any idea how to get the ServiceStack Client to work on Xamarin.Mac?

The IosPclExportClient should still be available for Unified API Projects as well, e.g:
ServiceStack.IosPclExportClient.Configure();

Related

Is there a way to access Windows APIs like CORTANA form electron / node.js apps?

I just got the "Creators Update" on winodws 10.
I've read a while back that Cortana speech apis will become available for developers trough an SDK in this update.
Given that the node.js run-time is not sandboxed like the browser - is there a way to get the native windows apis like Cortana working in node.js? and by extension in electron.. using something like
var cortana = require ('cortana');
I couldn't find any npm package at this point. But i can't tell if is because it's too soon - or because there is some incompatibility here.
Can someone provide an explanation of what is actually happening?
Sure there are ways to make APIs like Cortana works with your app, for example botbuilder is an excellent npm package you can use:
https://github.com/Microsoft/BotBuilder-Samples

Xamarin: Using native libraries in MVVMCross

Building a cross platform app that utilizes a native C library (using P/Invoke) to send commands to a remote server, how can it be architected to suit the MVVMCross framework?
Thanks!
It's not clear which framework(s) you are using.
Assuming iOS, see how to use P/Invoke at http://docs.xamarin.com/guides/ios/advanced_topics/native_interop
After getting the P/Invoke to work, if you need to access this in PCL code, then you'll need to use some form of dependency injection technique - one such technique is plugins - https://speakerdeck.com/cirrious/plugins-in-mvvmcross

ServiceStack web service hosting on monotouch/monodroid?

I'm currently trying to host a REST webservice on ios/android using Xamarin and monotouch/monodroid. I already successfully have a basic webserver running using HttpListener, but now I would like to host a complete webservice using ServiceStack.
monotouch/monodroid have very limited web hosting capabilities (HttpListener is basically the only way), but ServiceStack can in theory accomodate with that.
It seems to be possible as I found someone who did it: http://www.servicestack.net/mythz_blog/?p=417
The problem is that project does not work anymore on the last monotouch version, and ServiceStack seems to have removed server hosting capabilites in the monotouch/monodroid latest builds...
Xamarin have a fork of ServiceStack (https://github.com/xamarin/ServiceStack) which seems to have hosting capabilities, but the monotouch specific service hosting build does not compile, and the fork seems outdated.
Has anyone succeeded in making the ServiceStack hosting capabilities work on monotouch/monodroid? Or do you have an idea on how to make it work?
You might try this tutorial for self-hosting ServiceStack.
It looks like it will use HttpListener under the hood, but I don't know if the AppHostHttpListenerBase class will compile for MonoTouch/Mono for Android or not.
Ok so after some research, the project to allow ServiceStack self-hosting has been dropped. It had a better luck with the (old) Xamarin version (https://github.com/xamarin/ServiceStack) and could compile it and make it work somehow.
Since I need to be in sync with the latest ServiceStack version, I guess that I have no other choice than to roll my own adaptation, using the old Xamarin branch as a starting point.

Servicestack - run built-in clients on the .net client profile framework

Is it possible to run servicestack's built-in clients on the .net client profile framework?
When i change the target framework property in the project settings to ".Net Framework Client Profile" and try to compile i get the following message: the namespace ServiceClient does not exist in the namespace servicestack.
We use servicestack services to send exception reports. We use the JsonServiceClient and feel really comfortable with it. We could change the target framework - but then we have to check all installations for the availability of the full .net framework.
Any idea how to solve this?
Thanks.
From the package contents of the latest ServiceStack.Common package there seems to be no -client version included (See Common Framework and Profile Targeting Examples under NuGet - Creating and Publishing a Package).
You should either change the target framework the full profile or pull the code from ServiceStack's GitHub Repo and try to build it for client profile yourself. The downside of this is that you will loose Nuget's awesome update features...
You could off course file an issue at GitHub for the guys maintaining ServiceStack to add a client profile version of the framework, but I guess that there's a good reason for why it's not there already.

HaxeNME with smartfox server integration

I'm working on a multiplayer game that required the use of Smartfox server, surely I want to start creating the client side in HaxeNME to enable exportation to iphone / android / web at the same time. From my awareness, smartfox only support Flash (and others but not Haxe) client library. So, anyone already working on this can point me to the correct library or direction ? I really don't want to rewrite the client library for Haxe as it's time consuming ?
Or should I use other technology to develop this game ? I tended to fall back to Unity if there are no other way to get haxeNME works with smartfox ... Any idea, everyone ?
thanks for your answers !
I've ported AS3 smartfox to haxe/cpp.
All works quite fine except the BlueBox module because of nme.net.URLRequest that doesn't support POST method yet :/
But in the futur I'll use the SWC on flash target, Java and objectiveC for android and iOS with nme.JNI and nmex support...
If your target is CPP/NME, I'm afraid your only option is to port the SmartFox AS3 client code to Haxe.
There are some tools that can be helpful for the task. Look for as3hx.
If you mean using SWC files from smartfox, haXe does not currently support SWC linking, however you can use them. You'll first have to unzip the SWC to extract the library.swf and add it with --swf-lib library.swf to your compiler parameters.
More information on http://haxe.org/manual/swc

Resources