I am making use of github project for integrating Instagram with Android
My project requires me to browse user images from Instagram.
When I open the Login dialog and enter details, I able to login. It then opens the redirect url.
To test, I have a onSuccess() method and onFail()
`OAuthAuthenticationListener listener = new OAuthAuthenticationListener() {
@Override
public void onSuccess() {
tvSummary.setText("Connected as " + mApp.getUserName());
btnConnect.setText("Disconnect");
JSONArray jsonArray = mApp.getUserImages();}
public void onFail(String error) {
Toast.makeText(InstagramIntegrationActivity.this, error,
Toast.LENGTH_SHORT).show();
}`
Although the listener is registered,
mApp = new InstagramApp(this, ApplicationData.CLIENT_ID,it is not getting called.
ApplicationData.CLIENT_SECRET, ApplicationData.CALLBACK_URL);
mApp.setListener(listener);
In the onSuccess I have the code to parse the JSONObject and get the images.
Is there something that could be going because of which the onSoccess() on onFail() methods are not getting called?
Any help would be appreciated.
Thanks in advance.
I found the solution to the issue.
The logic and the code was right. But the mistake I had done was that I had tried registering two Applications with the same Website URI and Redirect URI in Instagram Developer Website
Correcting that solved the problem.