本文整理汇总了C#中Pubnub.RemoveChannelForDevicePush方法的典型用法代码示例。如果您正苦于以下问题:C# Pubnub.RemoveChannelForDevicePush方法的具体用法?C# Pubnub.RemoveChannelForDevicePush怎么用?C# Pubnub.RemoveChannelForDevicePush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pubnub
的用法示例。
在下文中一共展示了Pubnub.RemoveChannelForDevicePush方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ThenRemoveChannelForDeviceShouldReturnSuccess
public void ThenRemoveChannelForDeviceShouldReturnSuccess()
{
string channel = "hello_my_channel";
string pushToken = "http://sn1.notify.live.net/throttledthirdparty/01.00/AQG2MdvoLlZFT7-VJ2TJ5LnbAgAAAAADAQAAAAQUZm52OkRFNzg2NTMxMzlFMEZFNkMFBlVTU0MwMQ";
receivedSuccessMessage = false;
currentUnitTestCase = "ThenRemoveChannelForDeviceShouldReturnSuccess";
ThreadPool.QueueUserWorkItem((s) =>
{
Pubnub pubnub = new Pubnub(PubnubCommon.PublishKey, PubnubCommon.SubscribeKey, PubnubCommon.SecretKey, "", false);
PubnubUnitTest unitTest = new PubnubUnitTest();
unitTest.TestClassName = "WhenPushIsRequested";
unitTest.TestCaseName = "ThenRemoveChannelForDeviceShouldReturnSuccess";
pubnub.PubnubUnitTest = unitTest;
mrePush = new ManualResetEvent(false);
pubnub.RemoveChannelForDevicePush<string>(channel, PushTypeService.MPNS, pushToken, ChannelRemoveFromDeviceCallback, DummyErrorCallback);
mrePush.WaitOne(60 * 1000);
Assert.IsTrue(receivedSuccessMessage, "WhenPushIsRequested -> ThenRemoveChannelForDeviceShouldReturnSuccess failed.");
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
TestComplete();
});
});
}
示例2: Main
//.........这里部分代码省略.........
Console.WriteLine("Enter Push Token for MPNS");
string pushToken = Console.ReadLine();
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine(string.Format("Push Token = {0}", pushToken));
Console.ResetColor();
Console.WriteLine("Running RegisterDeviceForPush()");
pubnub.RegisterDeviceForPush<string>(pushRegisterChannel, PushTypeService.MPNS, pushToken, DisplayReturnMessage, DisplayErrorMessage);
break;
case "31":
Console.WriteLine("Enter Push Token for MPNS");
string unRegisterPushToken = Console.ReadLine();
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine(string.Format("Push Token = {0}", unRegisterPushToken));
Console.ResetColor();
Console.WriteLine("Running UnregisterDeviceForPush()");
pubnub.UnregisterDeviceForPush<string>(PushTypeService.MPNS, unRegisterPushToken, DisplayReturnMessage, DisplayErrorMessage);
break;
case "32":
Console.WriteLine("Enter channel name");
string pushRemoveChannel = Console.ReadLine();
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine(string.Format("Channel = {0}", pushRemoveChannel));
Console.ResetColor();
Console.WriteLine("Enter Push Token for MPNS");
string pushTokenRemove = Console.ReadLine();
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine(string.Format("Push Token = {0}", pushTokenRemove));
Console.ResetColor();
Console.WriteLine("Running RegisterDeviceForPush()");
pubnub.RemoveChannelForDevicePush<string>(pushRemoveChannel, PushTypeService.MPNS, pushTokenRemove, DisplayReturnMessage, DisplayErrorMessage);
break;
case "33":
Console.WriteLine("Enter Push Token for MPNS");
string pushTokenGetChannel = Console.ReadLine();
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine(string.Format("Push Token = {0}", pushTokenGetChannel));
Console.ResetColor();
Console.WriteLine("Running RegisterDeviceForPush()");
pubnub.GetChannelsForDevicePush<string>(PushTypeService.MPNS, pushTokenGetChannel, DisplayReturnMessage, DisplayErrorMessage);
break;
case "34":
//Toast message publish
Console.WriteLine("Enter channel name");
string toastChannel = Console.ReadLine();
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine(string.Format("Channel = {0}", toastChannel));
Console.ResetColor();
Console.WriteLine("Enter title for Toast");
string text1 = Console.ReadLine();
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine(string.Format("Text1 = {0}", text1));
Console.ResetColor();
MpnsToastNotification toast = new MpnsToastNotification();
toast.text1 = text1;
Dictionary<string, object> dicToast = new Dictionary<string, object>();
dicToast.Add("pn_mpns", toast);
pubnub.EnableDebugForPushPublish = true;
Console.WriteLine("Running Publish for Toast");