TheLester/Instagram-Helper


Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.thelester:instagram-Helper:-SNAPSHOT'
	}
	dependencies {
		implementation("com.github.thelester:instagram-Helper:-SNAPSHOT")
	}
	<dependency>
	    <groupId>com.github.thelester</groupId>
	    <artifactId>instagram-Helper</artifactId>
	    <version>-SNAPSHOT</version>
	</dependency>

                            
    libraryDependencies += "com.github.thelester" % "instagram-Helper" % "-SNAPSHOT"
        
        

                            
    :dependencies [[com.github.thelester/instagram-Helper "-SNAPSHOT"]]
        
        

Readme


[Important] Project is in not maintained. Feel free to fork it and support.

Instagram-Helper Android Arsenal

This is a library project which makes the instagram login much easier. Works from Android API 10 (Gingerbread) and above.

sample

Implemented with Instagram API client-Side (Implicit) authentication, which doesn't require store CLIENT SECRET on the client, more info...

Gradle

Add it to your app module build gradle.

dependencies {
      compile  'com.github.thelester:Instagram-Helper:1.1.1'
}

Usage

Initalize instagram-helper with your redirect_url and client_id (obtained [here] (https://instagram.com/developer/clients/manage/))

String scope = "basic+public_content+follower_list+comments+relationships+likes";
//scope is for the permissions
InstagramHelper instagramHelper = new InstagramHelper.Builder()
                                      .withClientId(CLIENT_ID)
                                      .withRedirectUrl(REDIRECT_URL)
                                      .withScope(scope)
                                      .build();

then launch Login activity from your activity:

instagramHelper.loginFromActivity(yourActivity);

and handle result:

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == InstagramHelperConstants.INSTA_LOGIN && resultCode == RESULT_OK) {
            InstagramUser user = instagramHelper.getInstagramUser(this);
            Picasso.with(this).load(user.getData().getProfilePicture()).into(userPhoto);
            userTextInfo.setText(user.getData().getUsername() + "\n"
                            + user.getData().getFullName() + "\n"
                            + user.getData().getWebsite()
            );

        } else {
            Toast.makeText(this, "Login failed", Toast.LENGTH_LONG).show();
        }

Dependencies

License

Copyright 2016 Dogar Dmitry

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.