Created
September 17, 2018 06:58
-
-
Save Collonville/d1d30622b27851dbd2a657396cdbfbee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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