Fuse version 0.33.0 (build 10195)
Windows 7
Code working, but only in preview (Local and Android)
C:\Users\Admin\Documents\Fuse\FastChat>fuse build -t=Android
Uno 0.44.5 (build 4604) Windows 7 x64 6b470b6
Configuring
socket.uno(7.15): E3111: Uno.Net does not contain type or namespace 'Sockets'. C
ould you be missing a package reference?
socket.uno(14.5): E3114: There is no identifier named 'Socket' accessible in thi
s scope. Did you mean 'Socket' (as in Uno.Net.Sockets.Socket)? For example, try
adding 'using Uno.Net.Sockets;' to the top of the code file. Could you be missin
g a package reference?
socket.uno(14.5): E3114: There is no identifier named 'Socket' accessible in thi
s scope. Did you mean 'Socket' (as in Uno.Net.Sockets.Socket)? For example, try
adding 'using Uno.Net.Sockets;' to the top of the code file. Could you be missin
g a package reference?
Build completed in 2.83 seconds
3 errors
fuse: Errors were encountered while building the project
This is piece of code
using Fuse;
using Fuse.Scripting;
using Fuse.Reactive;
using Uno.UX;
using Uno.Text;
using Uno.Threading;
using Uno.Net.Sockets;
[UXGlobalModule]
public class MySocket : NativeEventEmitterModule
{
static readonly MySocket _instance;
public delegate void ShowValue();
Socket socket;
public MySocket()
: base(true, "onMessageReceived", "onConnected", "onDisconnected", "onError")
{
// Make sure we're only initializing the module once
if(_instance != null) return;
_instance = this;
Resource.SetGlobalKey(_instance, "MySocket");
AddMember(new NativeFunction("connect", (NativeCallback)Connect));
AddMember(new NativeFunction("send", (NativeCallback)Send));
}
// Send
// Launched via Javascript
string Send(Context c, object[] args)
{
var message = args[0] as string;
try {
socket.Send(Utf8.GetBytes(message));
} catch(SocketException e) {
Emit("onError", e.Message.ToString());
}
return "";
}
And my .unoproj
{
"RootNamespace":"",
"Packages": [
"Fuse.Maps",
"Fuse",
"FuseJS",
"Fuse.Scripting"
],
"Includes": [
"*"
]
}