0

ionic 2 앱에 Azure/Facebook 인증을 추가하려면이 설명서 (https://docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-cordova-get-started-users)를 따르십시오. 단계에서는 ionic 2/cordova/angular 2 앱에 Azure/Facebook 인증 추가?

(3) 상기 onDeviceReady() 메소드를 찾아 편집을 위해 WWW/JS /하는 index.js 파일 열기

가, 클라이언트 생성 코드에서 다음 코드를 추가

그러나 scaffold ionic 2 프로젝트에서 www/js/index.js 파일을 찾을 수 없습니다. 어떤 파일을 수정해야합니까? app 아래의 파일 만 수정해야합니까? ionic 2 앱에 Azure 인증을 추가하는 단계별 문서가 있습니까?

enter image description here

답변

1

당신은 ionic-native은 코르도바 플러그인에 대한 지원을 제공 Facebook 인증을 추가하려면 platform.ready()

export class MyApp { 
    constructor(platform: Platform) { 
    platform.ready().then(() => { 
     // Okay, so the platform is ready and our plugins are available. 
     // Here you can do any higher level native things you might need. 
    } 
    } 
} 

내부 app.component.tsonDeviceReady 코드를 추가 할 수 있습니다. this을 확인하십시오. 설치가 쉽습니다. azure 코르도바를 들어

let permissions = ["public_profile","email"]; 
Facebook.login(permissions) 
.then((response) => { 
    let token = { access_token: response.authResponse.accessToken }; 
    return token; 
}).catch(this.handleError); 

는 당신이 시도 할 수있는 plugin 있습니다. 나는 그것을 시도하지 않았다.