/// <summary> /// Api Call for login /// </summary> /// <param name="deviceToken"></param> /// <param name="fbId"></param> /// <returns></returns> public JsonResult Challenge(string toFbID, string fromFbId, Guid code) { string fromUserFbName = string.Empty; try { string deviceToken = Player.Challenge(toFbID, fromFbId, ref code, ref fromUserFbName, null); PushManager pm = new PushManager(); pm.Challenge(deviceToken, code, fromUserFbName); return Json(new { Success = true, Data = "" }, JsonRequestBehavior.AllowGet); } catch (Exception ex) { return Json(new { Success = false, Message = ex.Message }, JsonRequestBehavior.AllowGet); } }
public ActionResult OnSendPush(string txtToken) { PushManager pm = new PushManager(); pm.SendTestPush(txtToken, "Test SplitMe Push Notification!"); return Redirect(Url.Action("SendPush")); }
/// <summary> /// Api Call for split the amount among friends /// </summary> /// <param name="fromPhone"></param> /// <param name="toPhones"></param> /// <returns></returns> public JsonResult Split(string fromPhone, string toPhones) { try { Dictionary<string, double> cisWithDeviceTokens = Common.Accounting.DoTransaction(fromPhone, toPhones); PushManager pm = new PushManager(); foreach (string devTkn in cisWithDeviceTokens.Keys) { string msg = string.Format("Your account is credited with ${0} from {1}.", cisWithDeviceTokens[devTkn], fromPhone); pm.SendPush(devTkn, msg); } return Json(new { Success = true, Data = "Transaction Completed." }, JsonRequestBehavior.AllowGet); } catch (Exception ex) { return Json(new { Success = false, Message = ex.Message }, JsonRequestBehavior.AllowGet); } }