Tag: 亚马逊

Amazon S3 Cognito – 从图像select器上传图像 – Swift 3

我已经成功将静态图像上传到AWS服务器。 当我把它与imagepicker结合,我面临一个奇怪的问题,因为相同的图像正在上传到AWS,即使我select和命名他们不同。 代码如下: internal func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { let image = info[UIImagePickerControllerOriginalImage] as! UIImage var imageUrl = info[UIImagePickerControllerReferenceURL] as? NSURL let imageName = imageUrl?.lastPathComponent let documentDirectory = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first! let photoURL = NSURL(fileURLWithPath: documentDirectory) let localPath = photoURL.appendingPathComponent(imageName!) print("image name : \(imageName)") if !FileManager.default.fileExists(atPath: localPath!.path) { do { […]

创build一个私有的Amazon API网关

我想为我的应用程序创build一个只能通过我的应用程序访问的api。 我已经将AWS Cognito标识添加到我的appDelegate中,如下所示: AWSCognitoCredentialsProvider *credentialsProvider = [[DeveloperAuthenticationProvider alloc] initWithRegionType:AWSRegionUSEast1 identityPoolId:@"poolId"]; AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:credentialsProvider]; AWSServiceManager.defaultServiceManager.defaultServiceConfiguration = configuration; __block NSString *cognitoId = nil; // Retrieve your Amazon Cognito ID [[credentialsProvider getIdentityId] continueWithBlock:^id(AWSTask *task) { if (task.error) { NSLog(@"Error: %@", task.error); } else { // the task result will contain the identity id cognitoId […]

错误:无法在任何存储库中find有效的gem'cocoapods'(> = 0)

我正在尝试运行一个AWS Cognito服务项目,其中我添加了适用于iOS的AWS开发工具包,但在添加并尝试运行之后,它会向我显示图像中显示的下面的错误 错误:无法在任何存储库中find有效的gem'cocoapods'(> = 0) 当我爬上它在互联网上,发现一些cocoapods安装说明,所以在尝试之后,我得到了一些像下面的其他错误 aparajita:Objective-C Aparajita$ sudo gem install cocoapods Password: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/rbconfig.rb:213: warning: Insecure world writable dir /usr/local in PATH, mode 040777 ERROR: Could not find a valid gem 'cocoapods' (>= 0) in any repository aparajita:Objective-C Aparajita$ gem install cocoapods /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/rbconfig.rb:213: warning: Insecure world writable dir /usr/local in PATH, mode 040777 ERROR: Could […]

从iOS / Android应用迁移s3下载到CloudFront

我们有iOS和Android应用程序下载s3的文件。 由于我们拥有全球客户,所以我们希望迁移到CloudFront。 我明白,为了做到这一点,我需要从/构build一个URL并发送NSURLRequest。 这意味着我不再使用专用的S3GetObjectRequest从桶中获取对象。 我想知道这是否是唯一的方法,或者有一种方法可以使用cloudFront与s3课程一起工作? 这是我的代码(iOS): – (int) request:(NSString*)request response:(NSData**)response { NSInteger httpStatus = 0; NSData* theData = NULL; NSString* cloudFrontDomain = [self cloudFrontDomain]; if(cloudFrontDomain){ NSString *urlString = [cloudFrontDomain stringByAppendingPathComponent: request]; NSURL *url = [[NSURL alloc] initWithString:urlString]; NSURLRequest *theRequest = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0]; NSError *error = nil; NSHTTPURLResponse *httpResponse = nil; theData = [NSURLConnection […]

Swift 3:Transfer Utility enumerateToAssignBlocks方法签名

官方AWS文档包含以下目标代码 AWSS3TransferUtility *transferUtility = [AWSS3TransferUtility defaultS3TransferUtility]; [transferUtility enumerateToAssignBlocksForUploadTask:^(AWSS3TransferUtilityUploadTask *uploadTask, __autoreleasing AWSS3TransferUtilityUploadProgressBlock *uploadProgressBlockReference, __autoreleasing AWSS3TransferUtilityUploadCompletionHandlerBlock *completionHandlerReference) { NSLog(@"%lu", (unsigned long)uploadTask.taskIdentifier); // Use `uploadTask.taskIdentifier` to determine what blocks to assign. *uploadProgressBlockReference = // Reassign your progress feedback block. *completionHandlerReference = // Reassign your completion handler. } downloadTask:^(AWSS3TransferUtilityDownloadTask *downloadTask, __autoreleasing AWSS3TransferUtilityDownloadProgressBlock *downloadProgressBlockReference, __autoreleasing AWSS3TransferUtilityDownloadCompletionHandlerBlock *completionHandlerReference) { NSLog(@"%lu", (unsigned […]

Cognito / IAM策略和S3获取对象

我正在尝试将S3和Cognito集成到我的iOS应用程序中,到目前为止还没有成功。 我相信错误是连接到我的身份validation和Unauth用户的IAM策略。 所以这是我的政策: { "Version": "2012-10-17", "Statement": [{ "Effect":"Allow", "Action":"cognito-sync:*", "Resource":["arn:aws:cognito-sync:us-east-1:XXXXXXXXXXXX:identitypool/${cognito-identity.amazonaws.com:aud}/identity/${cognito-identity.amazonaws.com:sub}/*"] }, { "Effect":"Allow", "Action": "s3:*", "Resource": ["arn:aws:s3:::my_bucket", "arn:aws:s3:::my_bucket/*"] } ] } 这里是我打电话给S3的地方: AWSS3GetObjectRequest *getObjectRequest = [[AWSS3GetObjectRequest alloc] init]; getObjectRequest.key = KEY; getObjectRequest.bucket = BUCKET; //default service has been configured previously AWSS3 *s3 = [[AWSS3 new] initWithConfiguration:[AWSServiceManager defaultServiceManager].defaultServiceConfiguration]; [[s3 getObject:getObjectRequest] continueWithBlock:^id(BFTask *task) { if(task.error) { […]

亚马逊SNS移动推送 – 如何批量订阅端点的主题?

我正试图将我现有的iOS推送通知基础设施移到亚马逊SNS移动推送。 我从我的本地数据库导出所有的令牌到SNS应用程序(使用CSV)。 现在我想发送推送通知给我所有的10,000个用户。 我认为唯一的方法是创build一个主题,并订阅该主题的所有用户,然后发布消息到该主题。 是否有任何简单的方法可以将我导入到系统中的所有10,000个用户订阅到一个主题? 谢谢你的帮助!

iPhone iOS亚马逊计划/ URI不再工作amzn:// version 4.3.1 Deep Linking

我们正在使用类似的计划 amzn://content/item?id=<some valid id> 而且工作得很好,但现在从亚马逊应用程序4.3.1,这不再工作,计划不再提供。 所以试试这个scheme就像 com.amazon.mobile.shopping://content/item?id=<some valid id> 我们在亚马逊应用程序中收到消息 Amazon Mobile is currently unavailable for content. 任何提示呢?

通过AFNetworking上传到Amazon-S3

我很难通过AFNetworking上传文件到S3。 当我尝试上传的时候,我得到的callback指出上传了一小部分文件,然后callback停止,一两分钟后我收到一条超时消息。 我正在使用AFAmazonS3Client,但它看起来像AFHTTPClient的一个非常简单的子类,所以它似乎不太可能存在问题。 由于我是AFNetworking和S3的新手,我很确定问题在于input这个消息:) 我已经下载了AWS-IOS SDK,并且能够从他们的示例代码中发布图片,没有任何问题。 所以我不认为它是我的S3帐户的configuration错误。

AMAZON AWS我如何订阅端点到SNS主题?

我正在使用Amazon SNS和Amazon Cognito服务在iOS应用程序中实施推送通知。 Cognito成功保存令牌,我的应用程序得到通知,一切运作良好,但有一件事情。 现在,在开发过程中,我需要手动将端点添加到SNS主题,以便所有订阅者都可以收到通知。 当我将更新推向App Store时,将会添加数千个令牌。 我正在研究亚马逊AWS文档,但是没有线索可以在没有额外努力的情况下实现。 我的问题:是否有可能自动订阅端点到一个只有亚马逊服务的主题?