public static async Task PushAPNSNotifyToUMessage(string deviceTokens, string appkey, string app_master_secret, UMengMessageModel model) { var type = deviceTokens.Contains(",") ? "listcast" : "unicast"; var p = new { appkey = appkey, timestamp = (long)BahamutCommon.DateTimeUtil.UnixTimeSpan.TotalSeconds, device_tokens = deviceTokens, type = type, #if DEBUG production_mode = "false", #endif payload = new { aps = new { alert = new { loc_key = model.LocKey }, badge = 1, sound = "default" }, custom = model.Custom } }; await PushNotifyToUMessage(app_master_secret, p); }
public static async Task PushAndroidNotifyToUMessage(string deviceTokens, string appkey, string app_master_secret, UMengMessageModel model) { var type = deviceTokens.Contains(",") ? "listcast" : "unicast"; var p = new { appkey = appkey, timestamp = (long)BahamutCommon.DateTimeUtil.UnixTimeSpan.TotalSeconds, device_tokens = deviceTokens, type = type, #if DEBUG production_mode = "false", #endif payload = new { body = new { ticker = model.Ticker == null ? "app_name" : model.Ticker, title = model.Title == null ? "new_msg" : model.Title, text = model.Text, after_open = model.AfterOpen, custom = model.Custom, builder_id = model.BuilderId }, extra = model.Extra, display_type = "notification" } }; await PushNotifyToUMessage(app_master_secret, p); }