Skip to content

Instantly share code, notes, and snippets.

View nimran's full-sized avatar

Mohammed Imran nimran

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
@nimran
nimran / AppDelegate.m
Created March 22, 2017 17:56
Amazon S3 Integration iOS
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
{
NSString *S3AccessKey = @"";
NSString *S3SecretKey = @"";
// Initialize based on static credential provider
AWSStaticCredentialsProvider *credentialsProvider = [[AWSStaticCredentialsProvider alloc] initWithAccessKey:S3AccessKey secretKey:S3SecretKey];
public void shareImageToTwitter() {
TwitterApiClient twitterApiClient = TwitterCore.getInstance().getApiClient();
File photo = new File(localImagePath);
TypedFile typedFile = new TypedFile("application/octet-stream", photo);
MediaService ms = twitterApiClient.getMediaService();
ms.upload(typedFile, null, null, new Callback<Media>() {
@Override
public void success(Result<Media> mediaResult) {