コード例 #1
0
        public TaskCompletionSource <NotificationResult> RegisterToShowImmediatly(IPlatformNotificationBuilder builder, ToastId toastId)
        {
            var(cdi, cci) = (builder.UsingCustomDeleteIntent, builder.UsingCustomContentIntent);
            TaskCompletionSource <NotificationResult> result = new TaskCompletionSource <NotificationResult>();

            if (cdi == false)
            {
                builder.SetDeleteIntent(CreateContentOrDeleteIntent(IntentConstants.KDismissed, builder, toastId));
            }
            if (cci == false)
            {
                SetContentIntent(builder, toastId);
            }

            lock (mutex)
                tasksByNotificationId.Add(toastId, result);
            if (cci)
            {
                result.TrySetResult(NotificationResult.Unknown);
            }
            return(result);
        }