nr-linkedin-browser
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -26,3 +26,3 @@ { | ||
}, | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"main": "core.js", | ||
@@ -29,0 +29,0 @@ "directories": { |
@@ -113,32 +113,40 @@ | ||
```javascript | ||
import {Component} from '@angular/core'; | ||
import {NavController, Platform} from 'ionic-angular'; | ||
import {Facebook, Google, LinkedIn} from "nr-linkedin-browser/core"; | ||
``` | ||
import { Component, OnInit } from '@angular/core'; | ||
import { NavController, Platform } from 'ionic-angular'; | ||
import { LinkedIn, LinkedInLoginScopes } from 'nr-linkedin'; | ||
import { LinkedInb } from "nr-linkedin-browser/core"; | ||
import {OauthCordova} from 'nr-linkedin-browser/platform/cordova'; | ||
@Component({ | ||
templateUrl: 'build/pages/home/home.html' | ||
selector: 'page-home', | ||
templateUrl: 'home.html' | ||
}) | ||
export class HomePage { | ||
export class HomePage implements OnInit { | ||
private oauth: OauthCordova = new OauthCordova(); | ||
private facebookProvider: Facebook = new Facebook({ | ||
clientId: "CLIENT_ID_HERE", | ||
appScope: ["email"] | ||
}) | ||
private loggedIn: boolean; | ||
scopes: LinkedInLoginScopes[] = ['r_basicprofile', 'r_emailaddress', 'rw_company_admin', 'w_share']; | ||
isLoggedIn: boolean = false; | ||
selfData = { id:"", firstName:"", lastName:"" }; | ||
constructor(private navCtrl: NavController, private platform: Platform) { } | ||
private oauth: OauthCordova = new OauthCordova(); | ||
private linkedinbProvider: LinkedInb = new LinkedInb({ | ||
clientId: "814imsl6ap5wcn", | ||
appScope: ["r_basicprofile","r_emailaddress"], | ||
redirectUri: "http://localhost/callback", | ||
responseType: "code", | ||
state: "DCEeFWf45A53sdfKef424" | ||
}) | ||
constructor(public navCtrl: NavController, private linkedin: LinkedIn, private platform: Platform) {} | ||
public linkedinb() { | ||
this.platform.ready().then(() => { | ||
this.oauth.logInVia(this.linkedinbProvider).then(success => { | ||
console.log("RESULT: " + JSON.stringify(success)); | ||
public facebook() { | ||
this.platform.ready().then(() => { | ||
this.oauth.logInVia(this.facebookProvider).then(success => { | ||
console.log("RESULT: " + JSON.stringify(success)); | ||
}, error => { | ||
console.log("ERROR: ", error); | ||
}); | ||
}, error => { | ||
console.log("ERROR: ", error); | ||
}); | ||
} | ||
}); | ||
} | ||
} | ||
``` | ||
@@ -145,0 +153,0 @@ Alternatively you can inject `OauthCordova` in constructor as shown in examples above. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36099
35
167