- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试将一些通用代码(例如用户登录)放入类库(可移植的通用应用程序)项目中,而不是标准的空白通用应用程序项目中。
不幸的是,我无法构建类库,因为此代码片段会引发错误:
No overload for method 'LoginAsync' takes 1 arguments
代码:
using Microsoft.WindowsAzure.MobileServices;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mobile.Common
{
public class UserHandler
{
/// ... properties, etc...
public async Task<bool> LoginAsync(MobileServiceAuthenticationProvider provider)
{
this.currentUser = await MobileService.LoginAsync(provider); //error occurs here
/// other code goes here...
}
}
}
我为我的类库项目安装了 Azure 移动服务 Nuget 包。基于以下论坛,我很清楚,在 Win8.1 或 WinPhone8.1 中,此代码可以正常工作:https://social.msdn.microsoft.com/Forums/en-US/720f607d-ad28-4d6b-b5e1-54145b243206/mobile-service-authentication?forum=azuremobile
但我不知道如何在我的类库项目中修复它。 ?
最佳答案
您正在调用的 LoginAsync() 方法是特定于平台的方法,定义为平台特定 dll 中客户端的扩展,因此无法从 PCL 中使用。
如果您查看 MobileServiceClient 的 PCL 版本,您会发现它仅支持您已从身份提供商获得 token 的登录。
以下是 Windows 应用商店如何为 Win 应用商店添加基于服务器的身份验证 UI(使用 Windows 身份验证代理)
关于c# - MobileServiceClient.LoginAsync() 引发方法 'LoginAsync' 没有重载需要 1 个参数错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29146335/
我正在尝试使用 Azure 移动服务客户端来验证我正在使用 Xamarin.Android 构建的应用程序。我的 MainActivity 有以下代码: [Activity(Label = "AppN
我正在尝试测试我的组件,该组件的构造函数已注入(inject)名为 AzureService 的服务 这是组件片段: constructor(private azureService: AzureSe
我正在使用 Android Azure 移动服务 SDK 连接到 Azure 移动服务。当我使用 MobileServiceClient 的 invokeApi 时,当 Api 在 60 秒内完成时一
我正在开发 Azure MobileService/CordovaApp 设置。服务器在本地运行并具有以下设置来启用 CORS: 可以使用诸如之类的地址通过浏览器调用 API http://loca
我有一个方法需要进行单元测试,但我被其中的模拟部分困住了。 private async void LoginCommandAsync() { ..... Can
在 Microsoft.WindowsAzure.MobileServices 命名空间中,根据here,类 MobileServiceClient 应该具有 LogoutAsync 方法。 。但它没
MobileServiceClient 的同步表运行良好。但是,我需要在移动/客户端应用程序中维护一个位于客户端的非同步表。 我的 Google 技能让我失败,因为我不断获得离线同步表教程。 有人知道
我想调试 WebApi 客户端项目。 客户端示例来自 Azure,可供使用。我通过更改显示的行将其配置为使用本地 WebAPI 后端 var client = new WindowsAzure.Mob
我目前的 facebook 登录流程 100% 正常工作,我刚刚将 Google 添加到了方程式中。我编写了代码,以便我的 google 提供商 token 的格式和缓存方式与我的 facebook
我正在尝试使用 Angular 中的 WindowsAzure.MobileServiceClient 来执行单点登录和 CRUD 操作。作为一个 Angular 菜鸟,我试图找出最好的方法来做到这一
这是我的代码: MobileServiceClient a = new MobileServiceClient("http://appitalo.azurewebsites.net/"); 当我尝试在
所以我只是摆弄 Azure,并决定考虑在一个简单的基于 Windows 8.1 Xaml 的应用程序中进行一些身份验证。我正在按照this中概述的步骤进行操作文档。 我当前设置了 MobileServ
我可以创建一个 MobileServiceClient 和 GetTable()至InsertAsync ,并查看如何将我的模型插入到 Azure 中的 Easy Table 表中。但是当我 Read
我正在构建一个 Apache Cordova 移动应用,使用 Azure 移动服务向 Google 进行身份验证。为此,我使用 WinJS azure 客户端: var client = new Wi
我需要创建一个没有应用程序 key 的 MobileServiceClient 对象。我该怎么做? 最佳答案 var client = new MobileServiceClient("http://
我正在使用 Azure-mobile-service 登录 facebook。但是登录后却显示消息。如何隐藏消息框? var client = new WindowsAzure.MobileServi
我需要创建一个没有应用程序 key 的 MobileServiceClient 对象。我该怎么做? 最佳答案 var client = new MobileServiceClient("http://
我正在使用 Azure-mobile-service 登录 facebook。但是登录后却显示消息。如何隐藏消息框? var client = new WindowsAzure.MobileServi
关于从客户端 Javascript (MobileServiceClient) 使用 Azure 移动服务,我仍然不太清楚的一件事是安全性。我的移动服务 Appkey 直接暴露在客户端 JavaScr
我正在尝试从同步表中创建过去 10 天的“新增内容”类型的列表。 我不想同步整个表,因为它包含数万行或过去 10 天具有 CreatedAt 的行。 await App.syncTablePerson
我是一名优秀的程序员,十分优秀!