Tag: amazon web services

如何连接到iOS应用程序中的EC2实例

我有一个AWS EC2实例和一个我创build的应用程序。 该应用程序适用于偏头痛的人(跟踪信息,告诉他们触发器是什么)。 现在,我希望能够将来自我的应用程序的用户input发送到服务器,以便我可以看到趋势。 我很难连接到服务器,并找出如何将文件写入服务器。 我写了这个方法: – (void) sendDataToServer:(NSString *)url :(NSString *)key : (NSString *) content{ // define your form fields here: //NSString *content = @"field1=42&field2=Hello"; NSString *address = [NSString stringWithFormat:@"ssh -i %@ %@", key, url]; NSLog(@"%@", address); NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:address]]; [request setHTTPMethod:@"POST"]; NSData *contentData = [content dataUsingEncoding:NSUTF8StringEncoding]; [request setHTTPBody:contentData]; NSString […]

亚马逊SNS(推送通知)不会发送到IOS应用程序

最近应用程序无法收到通知,android方面工作正常,但ios一个失败 所以这里是我所尝试的: 1) generate token from apple apn service 2) create the endpoint at amazon backend 3) publish the message at amazon backend 4) it does not receive message and the endpoint will go to disabled after a while. 我已经检查了以下内容: 1) try serveal ios device , including iphone/ ipad/ipod touch also the same result 2) […]

使用AWS Cognito Developer Identities从我的ios应用程序获取对DynamoDB的完全访问权限

我已经实施了AWS Lambdafunction,并使用网关返回填充数据: var param = { IdentityPoolId: "actualIdentityPoolId", Logins: {} // To have provider name in a variable }; param.Logins["com.testing.userLogin"] = userId; cognitoidentity.getOpenIdTokenForDeveloperIdentity(param, function(err, data) { if (err) return fn(err); // an error occurred else fn(null, data.IdentityId, data.Token); // successful response }); 所以身份标识和令牌被发送回ios设备。 在我的设备中,我尝试连接到AWS DynamoDB表,但访问被拒绝。 我如何使用identityId和令牌访问表? 我在IAM中为Unauth设置了angular色,拒绝Dydnamo和Auth,通过它的策略访问表。 我试图执行身份validation使用: http : //docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html 我看到有两个基本和增强的stream程。 该文档说,大多数用户将使用增强stream,并实现GetCredentialForIdentity。 这是如何实现在我的IOS代码,以便我可以将我的angular色从unauth切换到身份validation,并可以访问dynamodb? 这个访问会持续多久? […]

parsing开源服务器重置密码错误

我更新了parsing服务器在AWS上运行,当我点击重置密码但login工作时,我得到这个错误。 我不知道为什么这部分的代码有一个错误,而不是其他login和注册。 Error Domain=Parse Code=1 "{"code":1,"message":"Internal server error."}" UserInfo={error={"code":1,"message":"Internal server error."}, NSLocalizedDescription={"code":1,"message":"Internal server error."}, code=1} 这是我必须重置它的代码。 – (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { switch (alertView.alertViewStyle) { case UIAlertViewStylePlainTextInput: { UITextField *textField = [alertView textFieldAtIndex:0]; NSLog(@"Plain text input: %@",textField.text); NSString *original = textField.text; NSString *lowercase = [original lowercaseString]; NSLog(@"lowercase == %@",lowercase); // [PFUser requestPasswordResetForEmailInBackground:@"connorsapps@yahoo.com"]; [PFUser requestPasswordResetForEmailInBackground:lowercase block:^(BOOL succeeded, […]

在非关键属性上查询DynamoDB

是否有可能在AWS版本2中使用非键属性过滤DynamoDB查询? 亚马逊说,他们可以做到这一点: http : //amzn.to/1FVgQ9B 。 但他们是否也给API? 我发现AWSDynamoDBQueryExpression,但我认为它只允许过滤范围键(没有足够的文档)。 我在iOS和AWS版本2中寻找适当的API。谢谢!

iOS – AWS MobileHub使用开发人员身份validation的提供程序进行login

我试图了解如何使用AWS mobilehub的iOS SDK使用开发人员身份validation的身份进行loginAWS更改了此SDK,我找不到任何文档。 示例应用程序未能揭示这一点。 我有一个REST API来检索authenticationID和令牌,但我不知道如何处理他们,一旦我有这个。 AWS有以下不同的类别,这些问题更加复杂: AWSCredentialsProvider,AWSCognitoCredentialsProvider(不再在新SDK中可用),AWSSignInProvider,AWSAbstractCognitoIdentityProvider(在新的SDK中不再可用) 现在有一些叫做AWSAbstractCognitoIdentityProviderHelper的东西。 这些由AWSIdentityManager处理,它是AWSMobileHubHelper.framework的一部分,但AWSIdentityManager不允许您设置凭证提供程序,所以我不明白我在这方面是如何与之交互的。 任何教程,文档等将不胜感激

iOS(Swift)应用程序中的AWS Cognito用户池

我试图在我的iOS(Swift)应用程序中实现新的AWS Cognito用户池,但是我正努力使login过程正常工作。 我基本上试图按照这里提供的例子。 这是我迄今为止: AppDelegate中: class AppDelegate: UIResponder, UIApplicationDelegate, AWSCognitoIdentityInteractiveAuthenticationDelegate { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { let serviceConfiguration = AWSServiceConfiguration(region: AWSRegionType.USEast1, credentialsProvider: nil) AWSServiceManager.defaultServiceManager().defaultServiceConfiguration = serviceConfiguration let configurationUserPool = AWSCognitoIdentityUserPoolConfiguration( clientId: "###", clientSecret: "#########", poolId: "###") AWSCognitoIdentityUserPool.registerCognitoIdentityUserPoolWithConfiguration(serviceConfiguration, userPoolConfiguration: configurationUserPool, forKey: "UserPool") self.userPool = AWSCognitoIdentityUserPool(forKey: "UserPool") self.userPool!.delegate = self return true […]

如何使用AWS iOS SDK v2将UIImage上传到S3

Github中的README页面( https://github.com/aws/aws-sdk-ios-v2 )已经有一个上传图片的例子,从文件pathURL: AWSS3TransferManagerUploadRequest *uploadRequest = [AWSS3TransferManagerUploadRequest new]; uploadRequest.bucket = yourBucket; uploadRequest.key = yourKey; uploadRequest.body = yourDataURL; // <<<< this is a NSURL uploadRequest.contentLength = [NSNumber numberWithUnsignedLongLong:fileSize]; 但是,如果我只有一个UIImage在内存(没有文件path)? 是否可以使用SDK上传一个UIImage (或它的NSData )到S3 ? 手动使用HTTP API(使用类似AFNetworking的)会更容易吗?

iOS:有没有一种安全的方式在代码中包含API密钥?

Amazon拥有适用于iOS的AWS开发工具包,以及多个示例应用程序 。 在他们的示例中,他们将API凭证放在一个Constants.h文件中: // Constants used to represent your AWS Credentials. #define ACCESS_KEY_ID @"CHANGE ME" #define SECRET_KEY @"CHANGE ME" 我担心的是,这些可以由一个坚定的黑客提取。 有什么方法安全地在应用程序中包含API密钥? 我看到的一个select是包括我自己的服务器作为中介:应用程序与我的服务器通话,我的服务器与S3通信。 我可以看到这样做的价值,但仍然存在一个问题:我是否允许应用程序在我的服务器上进行API调用,而不进行任何forms的身份validation? 在应用程序中包含我自己的API密钥与包含AWS API密钥的问题相同。

为iOS创build一个用户authentication系统(以前用Parse希望AWS)

由于Parse正在消失,我最初使用_User和PFUser实现来创build用户身份validation过程。 自此我开始转向亚马逊的AWS Mobilie Hub。 我在Amazon Cognito系统中注意到,他们允许Google,Facebook,Amazon凭证供应商,我不想使用它。 我去看看自定义供应商的select。 我必须创build一个客户端和服务器端代码的自己的后端身份validation系统才能正常工作吗? 是否有一个简单的方式(但安全)像iOS Parse的iOSlogin过程? 谢谢,任何帮助将不胜感激(在线阅读了很多)。