Próbuję zrobić logowanie do Facebooka w aplikacji jonowej 2, ale otrzymałem ten błąd podczas budowania mojej aplikacji. pomóżcie mi rozwiązać ten problem.Moduł nie ma wyeksportowanego członka "IonicNativePlugin", Ionic2 na facebooka
[13:17:52] transpile zaczęło ... [13:17:58] maszynopis: D: /royalworkspace/newfblogin/node_modules/@ionic-native/facebook/index.d.ts, line: 1 Moduł "" D:/royalworkspace/newfblogin/node_modules/@ ionic-native/core/index "' nie ma wyeksportowanego członka " IonicNativePlugin ".
L1: import { IonicNativePlugin } from '@ionic-native/core'; L2: export interface FacebookLoginResponse {
- Home.ts -
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { Facebook, FacebookLoginResponse } from '@ionic-native/facebook';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
constructor(public navCtrl: NavController, private facebook: Facebook) {
}
Login(){
this.facebook.login(['email']).then((Response) =>{
alert('loged in');
alert(JSON.stringify(Response.authResponse));
},(error) => {
alert(error);
})
}
LoginDetails(){
this.facebook.getLoginStatus().then((response) => {
if (response.status == "connected") {
this.facebook.api('/' + response.authResponse.userID + '?fields=id,name,gender', []).then((response) =>{
alert(JSON.stringify(response));
}, (error) =>{
alert(error);
})
}
else{
alert('not loged in');
}
})
}
Logout(){
this.facebook.logout().then((Response) => {
alert(JSON.stringify(Response));
}, (error) =>{
alert(error);
})
}
}
- home.html -
<ion-content padding>
<button ion-button outline (click)="Login()">Login</button>
<button ion-button outline (click)="LoginDetails()">Login Details</button>
<button ion-button outline (click)="Logout()">Logout</button>
</ion-content>
- app.module -
import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { Facebook, FacebookLoginResponse } from '@ionic-native/facebook';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
@NgModule({
declarations: [
MyApp,
HomePage
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
providers: [
StatusBar,
SplashScreen,Facebook,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {}
Czy możesz pokazać swój plik 'pakiet.json'? – Sampath
Możesz to również zobaczyć: http://stackoverflow.com/a/43171634/1077309 – Sampath
**** ten sam błąd **** Moduł "" D:/royalworkspace/FacebookLogin-master/node_modules/@ ionic-native/core/index "" nie ma wyeksportowanego elementu "IonicNativePlugin" o numerze . L1: importuj {IonicNativePlugin} z '@ ionic-native/core'; L2: interfejs eksportu FacebookLoginResponse { –