2016-07-26 173 views
0

我正在嘗試遵循this關於使用AWS Cognito和AWS用戶池創建新用戶,更改密碼等的指南。我似乎無法找到適用於Android/iOS的適當的Xamarin SDK。有一個存在嗎?AWS Cognito for Xamarin

更具體地說,我在創建Cognito用戶池對象時遇到了問題。在我鏈接的示例中,他們有:

CognitoUserPool userPool = new CognitoUserPool(context, userPoolId, clientId, clientSecret); 

// user pool can also be created with client app configuration: 
CognitoUserPool userPool = new CognitoUserPool(context, userPoolId, clientId, clientSecret, clientConfiguration); 

似乎沒有CognitoUserPool類。在AWSSDK.CognitoIdentity庫中找不到類似或具有類似構造函數或任何內容的任何內容。我錯過了什麼,或者這只是不支持?

我也找不到類似於從Register a new user示例代碼SignUpHandler類東西如下所示:

// create a handler for registration 
SignUpHandler handler = new SignUpHandler() { 
    @Override 
    public void onSuccess(CognitoUser user, boolean signUpConfirmation) { 
     // The sign up was successful, "user" is a CognitoUser object of the user who was signed up. 

     // "signUpConfirmation" will indicate if user is already confirmed. 
    } 

    @override 
    public void onFailure(Exception exception) { 
     // Sign up failed, code check the exception for cause and perform remedial actions. 
    } 
} 

回答

2

我只是answered在另一篇文章中的類似問題。

簡短的回答,目前,Xamarin/Unity SDK不支持Cognito User Pools客戶端SDK。 API形狀可直接與服務交互,但您不會在除Android,iOS和JavaScript之外的任何其他SDK中找到助手,如CognitoUserPoolCognitoUser

+0

這很不幸。我希望他們計劃儘快更新他們的Xamarin SDK。 –

+0

這仍然是這種情況?現在差不多4個月後你發佈了這個。 –

1

Amazon提供通過的NuGet一個C#/。NET SDK,這將是最先進的。日期版本,並應提供您需要的功能。

你可以找到這個包在這裏:https://www.nuget.org/packages/AWSSDK.CognitoIdentity/

您也可以通過的NuGet控制檯下載的NuGet:

Install-Package AWSSDK.CognitoIdentity -Version 3.1.1.2 

最後,可以通過的NuGet在Xamarin工作室包通過搜索加入:

AWSSDK.CognitoIdentity 

謝謝!

+0

是的,我看到了。但似乎有一些缺失的事情。我沒有看到類似於我鏈接的Android示例中的CognitoUserPool類的類。我也找不到Xamarin AWS SDK的任何類似樣本。我不確定他們在Xamarin AWS SDK中是否有這個功能,因爲它仍然被認爲是測試版。 –

+0

嘿!讓我做一些測試,並在內部詢問團隊。我會回覆你:) – clb

+0

嘿!在這裏與團隊交談,看來最新的版本將是以下由亞馬遜提供的NuGet:https://www.nuget.org/packages/AWSSDK.CognitoIdentity/我將編輯我的答案以反映此包 – clb