public static IAsyncOperation<string> RegisterNotificationChannelAsync(string userId, string channelUri, string channelExpiration) { return AsyncInfo.Run<string>((token) => Task.Run<string>(() => { PushNotificationServiceClient client = new PushNotificationServiceClient(); var task = client.RegisterNotificationChannelAsync(userId, channelUri, channelExpiration); client.CloseAsync(); return task; }, token ) ); }
public static IAsyncOperation<string> GetDataAsync(int input) { return AsyncInfo.Run<string>((token) => Task.Run<string>(() => { PushNotificationServiceClient client = new PushNotificationServiceClient(); var task = client.GetDataAsync( input ); client.CloseAsync(); return task; }, token ) ); }