nraboy / ngx-cordova-oauth

Angular oauth library for use with Apache Cordova projects
MIT License
128 stars 65 forks source link

Issue with instagram in ionic 3 #64

Closed yaswanthkata closed 7 years ago

yaswanthkata commented 7 years ago

I have installed the plugin and added the code as following

import { Component } from '@angular/core'; import { NavController } from 'ionic-angular'; import { Instagram } from "ng2-cordova-oauth/core"; import { OauthCordova } from 'ng2-cordova-oauth/platform/cordova'; import { UserService } from '../../providers/user-service';

@Component({ selector: 'page-home', templateUrl: 'home.html' }) export class HomePage {

private oauth: OauthCordova = new OauthCordova();

private instagramProvider: Instagram = new Instagram({ clientId: "2d####################9", // Register you client id from https://www.instagram.com/developer/ redirectUri: 'http://localhost', // Let is be localhost for Mobile Apps responseType: 'token', // Use token only appScope: ['basic', 'public_content']

/*
appScope options are 

basic - to read a user’s profile info and media
public_content - to read any public profile info and media on a user’s behalf
follower_list - to read the list of followers and followed-by users
comments - to post and delete comments on a user’s behalf
relationships - to follow and unfollow accounts on a user’s behalf
likes - to like and unlike media on a user’s behalf

*/

});

private apiResponse;

constructor(public navCtrl: NavController, public UserService: UserService) { this.apiResponse = []; }

ngOnInit() { this.oauth.logInVia(this.instagramProvider).then((success) => {

  console.log(JSON.stringify(success));

  /* Returns User uploaded Photos */
  this.UserService.getInstagramUserInfo(success).subscribe(response => this.apiResponse = response.data);

}, (error) => {
  console.log(JSON.stringify(error));
});

}

}

I am redirected to insatgram login page ,but i always get an error as invalid username though i enter correct username and password.What am i doing wrong ,any inputs.

screenshot_1502791141

yaswanthkata commented 7 years ago

closing the issue