/// <summary> /// Exports information of all the devices that are using Push to an Azure Blob /// Storage /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='properties'> /// Export configurations. /// </param> /// <param name='ownerName'> /// The name of the owner /// </param> /// <param name='appName'> /// The name of the application /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ExportStartedResult> ExportDevicesAsync(this IPush operations, ExportConfig properties, string ownerName, string appName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ExportDevicesWithHttpMessagesAsync(properties, ownerName, appName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get list of notifications /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='ownerName'> /// The name of the owner /// </param> /// <param name='appName'> /// The name of the application /// </param> /// <param name='top'> /// The maximum number of results to return. (0 will fetch all results) /// </param> /// <param name='skiptoken'> /// The value identifies a starting point in the collection of entities. This /// parameter along with limit is used to perform pagination. /// </param> /// <param name='orderby'> /// controls the sorting order and sorting based on which column /// </param> /// <param name='inlinecount'> /// Controls whether or not to include a count of all the items across all /// pages. Possible values include: 'allpages', 'none' /// </param> /// <param name='includeArchived'> /// Include arhived push notifications /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <NotificationsListResult> ListAsync(this IPush operations, string ownerName, string appName, long?top = 30, string skiptoken = default(string), string orderby = "count desc", string inlinecount = default(string), bool?includeArchived = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(ownerName, appName, top, skiptoken, orderby, inlinecount, includeArchived, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Pushs the elements onto this collection, one by one. /// </summary> /// <typeparam name="TElement">The type of the elements in the collection.</typeparam> /// <param name="collection">This collection.</param> /// <param name="elements">The elements to push.</param> public static void Push <TElement>(this IPush <TElement> collection, ReadOnlySpan <TElement> elements) { for (Int32 i = 0; i < elements.Length; i++) { collection.Push(elements[i]); } }
/// <summary> /// Get configuration. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='ownerName'> /// The name of the owner /// </param> /// <param name='appName'> /// The name of the application /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <NotificationConfigResult> GetConfigAsync(this IPush operations, string ownerName, string appName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetConfigWithHttpMessagesAsync(ownerName, appName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public static unsafe void Push <TElement>(this IPush <TElement> collection, TElement *elements, Int32 length) where TElement : unmanaged { for (Int32 i = 0; i < length; i++) { collection.Push(elements[i]); } }
private async void btnPush_Click(object sender, RoutedEventArgs e) { ((Button)sender).IsEnabled = false; this.Cursor = Cursors.Wait; try { await Task.Run(() => { var type = typeof(MainWindow).Assembly.GetType($"RePushOrder.Impls.{_model.Channel}"); IPush push = (IPush)Activator.CreateInstance(type); push.Push(_model.Content, _model.Url); }); MessageBox.Show(this, "推送成功!"); } catch (Exception ex) { var err = ex; while (err.InnerException != null) { err = err.InnerException; } MessageBox.Show(this, err.Message); } finally { this.Cursor = null; ((Button)sender).IsEnabled = true; } }
public MessagesController(IRepository <ads_messages> messagesRepo, IRepository <user> userRepo, IRepository <device_tokens> deviceTokenRepo, IPush push) { _messagesRepo = messagesRepo; _deviceTokensRepo = deviceTokenRepo; _userRepo = userRepo; _pushNotification = push; }
/// <summary> /// Send notification. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='properties'> /// Notification specifications. /// </param> /// <param name='ownerName'> /// The name of the owner /// </param> /// <param name='appName'> /// The name of the application /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <NotificationSendSucceededResult> SendAsync(this IPush operations, NotificationDefinition properties, string ownerName, string appName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.SendWithHttpMessagesAsync(properties, ownerName, appName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
private void CheckForPushing(GameObject target) { IPush push = target.GetComponentInParent <IPush>(); if (push != null) { (float pushStrength, PushTypes pushType) = push.Push(); Push(pushStrength, pushType); } }
/// <summary> /// Pushs the elements onto this collection, one by one. /// </summary> /// <typeparam name="TElement">The type of the elements in the collection.</typeparam> /// <typeparam name="TEnumerator">The type of the enumerator of the <paramref name="elements"/>.</typeparam> /// <param name="collection">This collection.</param> /// <param name="elements">The elements to push.</param> public static void Push <TElement, TEnumerator>(this IPush <TElement> collection, IGetEnumerator <TElement, TEnumerator>?elements) where TEnumerator : notnull, ICurrent <TElement>, IMoveNext { if (elements is not null) { foreach (TElement element in elements) { collection.Push(element); } } }
/// <summary> /// Pushs the elements onto this collection, one by one. /// </summary> /// <typeparam name="TElement">The type of the elements in the collection.</typeparam> /// <param name="collection">This collection.</param> /// <param name="elements">The elements to push.</param> public static void Push <TElement>(this IPush <TElement> collection, Collections.Generic.IEnumerable <TElement>?elements) { if (elements is not null) { foreach (TElement element in elements) { collection.Push(element); } } }
public chatHub(ILifetimeScope lifetimeScope) { // Create a lifetime scope for the hub. _hubLifetimeScope = lifetimeScope.BeginLifetimeScope(); _messagesRepo = _hubLifetimeScope.Resolve <IRepository <ads_messages> >(); _userRepo = _hubLifetimeScope.Resolve <IRepository <user> >(); _deviceTokensRepo = _hubLifetimeScope.Resolve <IRepository <device_tokens> >(); _pushNotificationService = _hubLifetimeScope.Resolve <IPush>(); }
//------------------------------------------------------------------------- public Push() { #if UNITY_ANDROID && !UNITY_EDITOR mIPush = new AndroidPush(); #elif UNITY_IOS mIPush = new IOSPush(); #else //Debug.LogError("Do not supported on this platform. "); #endif }
public void Execute(object command, IPush executor) { try { executor.Push(command); } finally { _container.Release(executor); } }
public BlogController(IRepository <blog> blogRepo, IRepository <blog_sections> blogSectionsRepo, IRepository <place> placeRepo, IRepository <user> userRepo, IRepository <rating> rateRepo, IPush push, IRepository <device_tokens> deviceTokenRepo) { _blogRepo = blogRepo; _blogSectionsRepo = blogSectionsRepo; _deviceTokensRepo = deviceTokenRepo; _placeRepo = placeRepo; _userRepo = userRepo; _rateRepo = rateRepo; _pushNotification = push; }
public ApiPushIntegration(Guid key, long configurationId, ApiConfigurationIdentifier configuration, IntegrationClientIdentifier integrationClient, IntegrationContractIdentifier integrationContract, IntegrationPackageIdentifier packages, ClientIdentifier client, IPush<ApiInitializePushCommand> pusher) { Key = key; ConfigurationId = configurationId; Configuration = configuration; IntegrationClient = integrationClient; IntegrationContract = integrationContract; Packages = packages; Client = client; Pusher = pusher; }
public PushExecutor(string name) { IPushAdapter adapter = PushManager.PushAdapter; if (adapter == null) { Logger.Warn(Resources.Push_NotInitialized); } else { _instance = adapter.GetPushInstance(name); } }
private IContainer DoPush(IPush tag, IContainer parent, IValueStack stack) { Type type = null; if (!string.IsNullOrEmpty(tag.Type)) { type = GetType().Assembly.GetType(tag.Type, false, true); } object expr = stack.Evaluate(tag.Value, type); stack.Push(tag.Id, expr); return(parent); }
static void Main(string[] args) { // create a GenericStack<T> using the base type GenericStack <Car> carStack = new GenericStack <Car>(); // convert to the contravariant interface IPush <VolvoC30> volvoPush = carStack; // push in a value via the contravariant inteface volvoPush.Push(new VolvoC30()); // wait for input before exiting Console.WriteLine("Press enter to finish"); Console.ReadLine(); }
protected void Awake() { if (m_Instance != null) { Destroy(gameObject); return; } m_Instance = this; DontDestroyOnLoad(this.gameObject); #if UNITY_IOS __PushUnity3DBridge_init(this.gameObject.name, "OnCallBack"); #elif UNITY_ANDROID _androidPushManager.Call("init", this.gameObject.name, "OnCallBack"); #endif }
protected void Awake() { if (m_Instance != null) { Destroy(gameObject); return; } m_Instance = this; DontDestroyOnLoad(this.gameObject); //Debug.LogError("=====Awake======"+ this.gameObject.name); #if UNITY_IOS && !UNITY_EDITOR //__PushUnity3DBridge_init(this.gameObject.name, "OnCallBack"); #elif UNITY_ANDROID && !UNITY_EDITOR _androidPushManager.Call("init", this.gameObject.name, "OnCallBack"); #endif }
/* * 为了确保用户发送的请求不被更改,我们设计了签名算法。该算法基本可以保证请求是合法者发送且参数没有被修改,但无法保证不被偷窥。 签名生成规则: * A)提取请求方法method(POST,全大写); * B)提取请求url信息,包括Host字段的域名(或ip:端口)和URI的path部分。注意不包括path的querystring。 * 比如http://msg.umeng.com/api/send 或者 http://msg.umeng.com/api/status; * C)提取请求的post-body; * D)拼接请求方法、url、post-body及应用的app_master_secret; * E)将D形成字符串计算MD5值,形成一个32位的十六进制(字母小写)字符串,即为本次请求sign(签名)的值; * Sign=MD5($http_method$url$post-body$app_master_secret); */ public static string GetSign(DeviceType type, string url, IPush postbody) { var app_master_secret = string.Empty; if (type == DeviceType.Andriod) { app_master_secret = "c02mxn27sntad8nr9am2dwd4ruddl4jf"; } else if (type == DeviceType.IOS) { //57d0f6f8e0f55a1619000914 //f1r4glcnnimzpfnqikdi5glntps8k1f7 app_master_secret = "f1r4glcnnimzpfnqikdi5glntps8k1f7"; } else if (type == DeviceType.IOS_APPStore) { app_master_secret = "6khvrxf6idmfwrythbjdo5rmwlcty0qq"; } else if (type == DeviceType.Android_Center) { app_master_secret = "qnmiba5fthsf3eciqx6khxdxkomc136c"; } ///易指控 else if (type == DeviceType.YZK_IOS_APPStore) { app_master_secret = "xfldioemvvsewnkzcr45ge8s86knuihz"; } if (!string.IsNullOrEmpty(app_master_secret)) { var postbodyjson = JsonHelper <IPush> .GetJson(postbody); var sign = EncryptHelper.MD5Encoding("POST" + url + postbodyjson + app_master_secret); return(sign); } else { return(string.Empty); } }
/// <summary> /// Get configuration. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='ownerName'> /// The name of the owner /// </param> /// <param name='appName'> /// The name of the application /// </param> public static NotificationConfigResult GetConfig(this IPush operations, string ownerName, string appName) { return(operations.GetConfigAsync(ownerName, appName).GetAwaiter().GetResult()); }
/// <summary> /// Send notification. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='notificationIds'> /// List of notification ids /// </param> /// <param name='ownerName'> /// The name of the owner /// </param> /// <param name='appName'> /// The name of the application /// </param> public static void Delete(this IPush operations, NotificationIdList notificationIds, string ownerName, string appName) { operations.DeleteAsync(notificationIds, ownerName, appName).GetAwaiter().GetResult(); }
/// <summary> /// Delete device/installId /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='installId'> /// device install id /// </param> /// <param name='ownerName'> /// The name of the owner /// </param> /// <param name='appName'> /// The name of the application /// </param> public static void DeleteInstallId(this IPush operations, string installId, string ownerName, string appName) { operations.DeleteInstallIdAsync(installId, ownerName, appName).GetAwaiter().GetResult(); }
/// <summary> /// Delete device/installId /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='installId'> /// device install id /// </param> /// <param name='ownerName'> /// The name of the owner /// </param> /// <param name='appName'> /// The name of the application /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteInstallIdAsync(this IPush operations, string installId, string ownerName, string appName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteInstallIdWithHttpMessagesAsync(installId, ownerName, appName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Get status of export operation. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='exportId'> /// The id of the export. /// </param> /// <param name='ownerName'> /// The name of the owner /// </param> /// <param name='appName'> /// The name of the application /// </param> public static ExportStatusResult ExportDevicesStatus(this IPush operations, string exportId, string ownerName, string appName) { return(operations.ExportDevicesStatusAsync(exportId, ownerName, appName).GetAwaiter().GetResult()); }
/// <summary> /// Returns whether push config exists. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='ownerName'> /// The name of the owner /// </param> /// <param name='appName'> /// The name of the application /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task ConfigExistsAsync(this IPush operations, string ownerName, string appName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.ConfigExistsWithHttpMessagesAsync(ownerName, appName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
private IContainer DoPush(IPush tag, IContainer parent, IValueStack stack) { Type type = null; if (!string.IsNullOrEmpty(tag.Type)) type = GetType().Assembly.GetType(tag.Type, false, true); object expr = stack.Evaluate(tag.Value, type); stack.Push(tag.Id, expr); return parent; }
/// <summary> /// Returns whether push config exists. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='ownerName'> /// The name of the owner /// </param> /// <param name='appName'> /// The name of the application /// </param> public static void ConfigExists(this IPush operations, string ownerName, string appName) { operations.ConfigExistsAsync(ownerName, appName).GetAwaiter().GetResult(); }
/// <summary> /// Exports information of all the devices that are using Push to an Azure Blob /// Storage /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='properties'> /// Export configurations. /// </param> /// <param name='ownerName'> /// The name of the owner /// </param> /// <param name='appName'> /// The name of the application /// </param> public static ExportStartedResult ExportDevices(this IPush operations, ExportConfig properties, string ownerName, string appName) { return(operations.ExportDevicesAsync(properties, ownerName, appName).GetAwaiter().GetResult()); }
/// <summary> /// Send notification. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='notificationIds'> /// List of notification ids /// </param> /// <param name='ownerName'> /// The name of the owner /// </param> /// <param name='appName'> /// The name of the application /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAsync(this IPush operations, NotificationIdList notificationIds, string ownerName, string appName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteWithHttpMessagesAsync(notificationIds, ownerName, appName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Send notification. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='properties'> /// Notification specifications. /// </param> /// <param name='ownerName'> /// The name of the owner /// </param> /// <param name='appName'> /// The name of the application /// </param> public static NotificationSendSucceededResult Send(this IPush operations, NotificationDefinition properties, string ownerName, string appName) { return(operations.SendAsync(properties, ownerName, appName).GetAwaiter().GetResult()); }