本文整理汇总了C#中Microsoft.WindowsAzure.MobileServices.MobileServiceClient.InvokeApiAsync方法的典型用法代码示例。如果您正苦于以下问题:C# MobileServiceClient.InvokeApiAsync方法的具体用法?C# MobileServiceClient.InvokeApiAsync怎么用?C# MobileServiceClient.InvokeApiAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.WindowsAzure.MobileServices.MobileServiceClient
的用法示例。
在下文中一共展示了MobileServiceClient.InvokeApiAsync方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Button_Click
private async void Button_Click(object sender, RoutedEventArgs e)
{
ClearTextbox();
try
{
SelLoginIDDupeCheck selLoginIDDupeCheck = new SelLoginIDDupeCheck();
//selLoginIDDupeCheck.memberID = crypto
var client = new MobileServiceClient(serverURL.Text, serverKey.Password);
string j = @"{""memberID"": ""aaa"" }";
//토큰 = body 텍스트 - 으로 바로 로드
inputTextbox.Text = j;
JToken token = JObject.Parse(j);
var orderResult = await client.InvokeApiAsync("CBSelLoginIDDupeCheck", token);
outputTextbox.Text = orderResult.ToString();
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
}
示例2: UploadChannel
public async static void UploadChannel()
{
PushNotificationChannel channel;
try
{
channel = await PushNotificationChannelManager
.CreatePushNotificationChannelForApplicationAsync();
channel.PushNotificationReceived += channel_PushNotificationReceived;
}
catch (Exception)
{
// TODO: Do something when Push Notifications are not available?
return;
}
try
{
JObject templateBody = new JObject();
templateBody["body"] = String.Format(@"<toast>
<visual>
<binding template=""ToastText01"">
<text id=""1"">$(message)</text>
</binding>
</visual>
</toast>");
JObject wnsToastHeaders = new JObject();
wnsToastHeaders["X-WNS-Type"] = "wns/toast";
templateBody["headers"] = wnsToastHeaders;
JObject templates = new JObject();
templates["MyHealthClinicTemplate"] = templateBody;
client = new MobileServiceClient(AppSettings.MobileAPIUrl, string.Empty, string.Empty);
await client.GetPush()
.RegisterAsync(channel.Uri, templates);
// Add a new tag to get only the notification for the default patientId.
var tags = new JArray();
tags.Add(AppSettings.DefaultTenantId);
// Call the custom API '/api/updatetags/<installationid>' with the JArray of tags.
var response = await client
.InvokeApiAsync("updatetags/"
+ client.InstallationId, tags);
}
catch (Exception)
{
// Handle Exception
}
}
示例3: GetStorageCredentials
private async Task<StorageCredentials> GetStorageCredentials (bool forPhotos)
{
// First get the SAS Token from Mobile Services API
var mobileServiceClient = new MobileServiceClient (AzureConstants.MobileServiceUrl,
AzureConstants.MobileServiceAppKey);
// Determine which container we want and create a dictionary to request it
var containerName = forPhotos ? AzureConstants.StoragePhotoContainerName : AzureConstants.StorageAudioContainerName;
var requestDict = new Dictionary<string,string> () { { "container", containerName } };
// Invoke the custom API in the mobile services to get the storage SAS token
var token = await mobileServiceClient
.InvokeApiAsync<string> (AzureConstants.MobileServiceAPISasName, HttpMethod.Get, requestDict);
// Create the storage credentials
return new StorageCredentials (token);
}
示例4: OnCreateView
public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
{
base.OnCreateView (inflater, container, savedInstanceState);
var view = inflater.Inflate (Resource.Layout.Dialog_SingIn, container, false);
btn = view.FindViewById<Button> (Resource.Id.siBtn);
username = view.FindViewById<EditText> (Resource.Id.siTxtUsername);
password = view.FindViewById<EditText> (Resource.Id.siTxtPassword);
btn.Enabled = false;
username.AfterTextChanged += (object sender, Android.Text.AfterTextChangedEventArgs e) => {
EnableSaveItemButton();
};
password.AfterTextChanged += (object sender, Android.Text.AfterTextChangedEventArgs e) => {
EnableSaveItemButton();
};
btn.Click += async (sender, e) => {
try {
client = new MobileServiceClient (AppConstant.applicationURL, AppConstant.applicationKey);
LoginRequest request = new LoginRequest(username.Text, password.Text);
this.user = await client.InvokeApiAsync<LoginRequest, MobileServiceUser>("CustomLogin", request);
Toast.MakeText (Activity, "User Login Successfully!", ToastLength.Long).Show ();
Intent intent = new Intent(Activity, typeof(ToDoActivity));
intent.PutExtra("UserID", user.UserId);
intent.PutExtra("UserToken", user.MobileServiceAuthenticationToken);
this.StartActivity(intent);
this.Dismiss();
} catch (Exception ex) {
Toast.MakeText (Activity, "Ups Something is wrong, try later!", ToastLength.Long).Show ();
Console.WriteLine("Error" + ex.ToString());
}
};
return view;
}
示例5: OnCreateView
public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
{
base.OnCreateView (inflater, container, savedInstanceState);
var view = inflater.Inflate (Resource.Layout.Dialog_SingUp, container, false);
btn = view.FindViewById<Button> (Resource.Id.suBtn);
username = view.FindViewById<EditText> (Resource.Id.suTxtUsername);
password = view.FindViewById<EditText> (Resource.Id.suTxtPassword);
confirmpassword = view.FindViewById<EditText> (Resource.Id.suTxtPassword2);
btn.Enabled = false;
username.AfterTextChanged += (object sender, Android.Text.AfterTextChangedEventArgs e) => {
EnableSaveItemButton();
};
password.AfterTextChanged += (object sender, Android.Text.AfterTextChangedEventArgs e) => {
EnableSaveItemButton();
};
confirmpassword.AfterTextChanged += (object sender, Android.Text.AfterTextChangedEventArgs e) => {
EnableSaveItemButton();
};
btn.Click += async (sender, e) => {
try {
client = new MobileServiceClient (AppConstant.applicationURL, AppConstant.applicationKey);
RegistrationRequest request = new RegistrationRequest(username.Text, password.Text);
var user = await client.InvokeApiAsync<RegistrationRequest, Object>("CustomRegistration", request);
Toast.MakeText (Activity, "User Create Successfully!", ToastLength.Long).Show ();
this.Dismiss();
} catch (Exception ex) {
Toast.MakeText (Activity, "Ups Something is wrong, try later!", ToastLength.Long).Show ();
Console.WriteLine("Error" + ex.ToString());
}
};
return view;
}
示例6: CBInsRegMemberClick
private async void CBInsRegMemberClick(object sender, RoutedEventArgs e)
{
ClearTextbox();
try
{
var client = new MobileServiceClient(serverURL.Text, serverKey.Password);
string j = @"{
""memberID_Members"": ""회원ID-GUID"",
""memberPWD_Members"": ""GUID"",
""emailAddress_Members"": ""[email protected]"",
""emailConfirmedYN_Members"": ""N"",
""phoneNumber1_Members"": ""전화번호1-GUID"",
""phoneNumber2_Members"": ""전화번호2-GUID"",
""piNumber_Members"": ""개인식별번호-GUID"",
""name1_Members"": ""이름1-GUID"",
""name2_Members"": ""이름2-GUID"",
""name3_Members"": ""이름3-GUID"",
""dob_Members"": ""19990101"",
""recommenderID_Members"": ""추천인ID-GUID"",
""memberGroup_Members"": ""회원그룹-GUID"",
""lastDeviceID_Members"": ""최종접속시디바이스ID-GUID"",
""lastIPaddress_Members"": ""최종접속IP주소-GUID"",
""lastLoginDT_Members"": ""1900-01-01"",
""lastLogoutDT_Members"": ""1900-01-01"",
""lastMACAddress_Members"": ""최종접속MAC주소-GUID"",
""accountBlockYN_Members"": ""N"",
""accountBlockEndDT_Members"": ""1900-01-01"",
""anonymousYN_Members"": ""N"",
""_3rdAuthProvider_Members"": ""외부인증제공자"",
""_3rdAuthID_Members"": ""외부인증ID"",
""_3rdAuthParam_Members"": ""외부인증파라미터"",
""pushNotificationID_Members"": ""푸쉬ID"",
""pushNotificationProvider_Members"": ""푸쉬서비스제공자"",
""pushNotificationGroup_Members"": ""푸쉬그룹"",
""sCol1_Members"": ""여분의컬럼1-GUID"",
""sCol2_Members"": ""여분의컬럼2-GUID"",
""sCol3_Members"": ""여분의컬럼3-GUID"",
""sCol4_Members"": ""여분의컬럼4-GUID"",
""sCol5_Members"": ""여분의컬럼5-GUID"",
""sCol6_Members"": ""여분의컬럼6-GUID"",
""sCol7_Members"": ""여분의컬럼7-GUID"",
""sCol8_Members"": ""여분의컬럼8-GUID"",
""sCol9_Members"": ""여분의컬럼9-GUID"",
""sCol10_Members"": ""여분의컬럼10-GUID"",
""timeZoneID_Members"": ""Korea Standard Time"",
""level_MemberGameInfoes"": ""1"",
""exps_MemberGameInfoes"": ""0"",
""points_MemberGameInfoes"": ""1000"",
""userSTAT1_MemberGameInfoes"": ""사용자상태속성1-GUID"",
""userSTAT2_MemberGameInfoes"": ""사용자상태속성2-GUID"",
""userSTAT3_MemberGameInfoes"": ""사용자상태속성3-GUID"",
""userSTAT4_MemberGameInfoes"": ""사용자상태속성5-GUID"",
""userSTAT5_MemberGameInfoes"": ""사용자상태속성5-GUID"",
""userSTAT6_MemberGameInfoes"": ""사용자상태속성6-GUID"",
""userSTAT7_MemberGameInfoes"": ""사용자상태속성7-GUID"",
""userSTAT8_MemberGameInfoes"": ""사용자상태속성8-GUID"",
""userSTAT9_MemberGameInfoes"": ""사용자상태속성9-GUID"",
""userSTAT10_MemberGameInfoes"": ""사용자상태속성10-GUID"",
""sCol1_MemberGameInfoes"": ""여분의컬럼1-GUID"",
""sCol2_MemberGameInfoes"": ""여분의컬럼2-GUID"",
""sCol3_MemberGameInfoes"": ""여분의컬럼3-GUID"",
""sCol4_MemberGameInfoes"": ""여분의컬럼4-GUID"",
""sCol5_MemberGameInfoes"": ""여분의컬럼5-GUID"",
""sCol6_MemberGameInfoes"": ""여분의컬럼6-GUID"",
""sCol7_MemberGameInfoes"": ""여분의컬럼7-GUID"",
""sCol8_MemberGameInfoes"": ""여분의컬럼8-GUID"",
""sCol9_MemberGameInfoes"": ""여분의컬럼9-GUID"",
""sCol10_MemberGameInfoes"": ""여분의컬럼10-GUID""
}";
//토큰 = body 텍스트 - 으로 바로 로드
inputTextbox.Text = j;
JToken token = JObject.Parse(j);
var orderResult = await client.InvokeApiAsync("CBInsRegMember", token);
outputTextbox.Text = orderResult.ToString();
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
}
示例7: CBAddUseMemberItemDELETEClick
private async void CBAddUseMemberItemDELETEClick(object sender, RoutedEventArgs e)
{
ClearTextbox();
try
{
var client = new MobileServiceClient(serverURL.Text, serverKey.Password);
string j = @"{
""insertORUpdateORDelete"": ""DELETE"",
""memberItemID_MemberItem"": ""회원의아이템ID1-원래고유값"",
""memberID_MemberItem"": null,
""itemListID_MemberItem"": null,
""itemCount_MemberItem"": null,
""itemStatus_MemberItem"": null,
""hideYN_MemberItem"": null,
""deleteYN_MemberItem"": null,
""sCol1_MemberItem"": null,
""sCol2_MemberItem"": null,
""sCol3_MemberItem"": null,
""sCol4_MemberItem"": null,
""sCol5_MemberItem"": null,
""sCol6_MemberItem"": null,
""sCol7_MemberItem"": null,
""sCol8_MemberItem"": null,
""sCol9_MemberItem"": null,
""sCol10_MemberItem"": null,
""memberID_MemberGameInfoes"": ""aaa"",
""level_MemberGameInfoes"": ""99"",
""exps_MemberGameInfoes"": ""999"",
""points_MemberGameInfoes"": ""999"",
""userSTAT1_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된상태값1-GUID"",
""userSTAT2_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된상태값2-GUID"",
""userSTAT3_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된상태값3-GUID"",
""userSTAT4_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된상태값4-GUID"",
""userSTAT5_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된상태값5-GUID"",
""userSTAT6_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된상태값6-GUID"",
""userSTAT7_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된상태값7-GUID"",
""userSTAT8_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된상태값8-GUID"",
""userSTAT9_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된상태값9-GUID"",
""userSTAT10_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된상태값10-GUID"",
""sCol1_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된여분의컬럼1-GUID"",
""sCol2_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된여분의컬럼2-GUID"",
""sCol3_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된여분의컬럼3-GUID"",
""sCol4_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된여분의컬럼4-GUID"",
""sCol5_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된여분의컬럼5-GUID"",
""sCol6_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된여분의컬럼6-GUID"",
""sCol7_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된여분의컬럼7-GUID"",
""sCol8_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된여분의컬럼8-GUID"",
""sCol9_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된여분의컬럼9-GUID"",
""sCol10_MemberGameInfoes"": ""다시DELETE로변경된게임중변경된여분의컬럼10-GUID""
}";
// null 으로 주거나 로우를 뺀다.
//토큰 = body 텍스트 - 으로 바로 로드
inputTextbox.Text = j;
JToken token = JObject.Parse(j);
var orderResult = await client.InvokeApiAsync("CBAddUseMemberItem", token);
outputTextbox.Text = orderResult.ToString();
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
}
示例8: CBSelMemberItemsClick
private async void CBSelMemberItemsClick(object sender, RoutedEventArgs e)
{
ClearTextbox();
try
{
var client = new MobileServiceClient(serverURL.Text, serverKey.Password);
string j = @"{
""memberID"": ""aaa"",
""page"": 1,
""pageSize"": 5
}";
//토큰 = body 텍스트 - 으로 바로 로드
inputTextbox.Text = j;
JToken token = JObject.Parse(j);
var orderResult = await client.InvokeApiAsync("CBSelMemberItems", token);
outputTextbox.Text = orderResult.ToString();
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
}
示例9: RegisteredForRemoteNotifications
public override async void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
{
try
{
// Instantiate a MobileService Client
_client = new MobileServiceClient(AppSettings.MobileAPIUrl);
// Register for push with your mobile app
var push = _client.GetPush();
var notificationTemplate = "{\"aps\":{\"alert\":\"$(message)\"}}";
JObject templateBody = new JObject();
templateBody["body"] = notificationTemplate;
JObject templates = new JObject();
templates["testApsTemplate"] = templateBody;
await push.RegisterAsync(deviceToken, templates);
// Add a new tag to get only the notification for the default patientId.
var tags = new JArray();
tags.Add(AppSettings.DefaultTenantId);
await _client.InvokeApiAsync("updatetags/" + _client.InstallationId, tags);
}
catch (Exception e)
{
Debug.WriteLine("RegisteredForRemoteNotifications -> exception -> " + e.Message);
}
}