Skip to content

Commit

Permalink
Update firebase function
Browse files Browse the repository at this point in the history
  • Loading branch information
C1rdec committed Apr 24, 2020
1 parent 03adbbe commit 51e8355
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/Lurker.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@ namespace Lurker.Console
using Lurker.Services;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Text;

class Program
{
static void Main(string[] args)
{
var httpClient = new HttpClient();
var json = JsonConvert.SerializeObject(new { Name = "Cedric", LastName = "Lampron"});
var data = new StringContent(json, Encoding.UTF8, "application/json");
var message = httpClient.PostAsync("https://us-central1-poe-lurker.cloudfunctions.net/sendTradeMessage", data).Result;

var model = new Collaboration()
{
ExpireDate = DateTime.Now.AddDays(10)
Expand Down
6 changes: 3 additions & 3 deletions src/Lurker.Mobile/functions/functions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import * as admin from 'firebase-admin';

admin.initializeApp();
const fcm = admin.messaging();
const token = "[Token]";
const token = "c_QIkJm668Q:APA91bEN_AqY47lBMaK-rN6e7fk8r7Ey_tkUyRux3SeMVmlrNEkmBB7r6ujil5h-llJCV9itr5KfsPQjIIkhuXAnj_SBdSV_20gGtZsgPd2u1OtU4VO16aEDZE8WxAkgt8HnoASoma6l";

// Start writing Firebase Functions
// https://firebase.google.com/docs/functions/typescript

export const sendTradeMessage = functions.https.onRequest((request, response) => {
response.send("Hello from Firebase!");
return fcm.send({token: token, data: {test:"allo"}});
response.send("Hello from Firebase!!");
return fcm.send({token: token, data: request.body});
});

0 comments on commit 51e8355

Please sign in to comment.