Skip to content

Instantly share code, notes, and snippets.

@Collonville
Created September 17, 2018 06:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Collonville/d1d30622b27851dbd2a657396cdbfbee to your computer and use it in GitHub Desktop.
Save Collonville/d1d30622b27851dbd2a657396cdbfbee to your computer and use it in GitHub Desktop.
using FireSharp;
using FireSharp.Config;
using FireSharp.Interfaces;
using FireSharp.Response;
using System;
namespace FireBaseChat
{
class Program
{
static private IFirebaseClient client;
static void Main(string[] args)
{
client = new FirebaseClient(new FirebaseConfig
{
AuthSecret = "DB Secret Key",
BasePath = "DB URL"
});
PostMessage("Hello, Firebase!!!");
//終了するとコンソール画面が閉じるのを防ぐ
Console.Read();
}
private static async void PostMessage(string message)
{
PushResponse result = await client.PushAsync("chats/", new Message { MessageString = message });
}
}
public class Message
{
public string MessageString { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment