我想在我的ionic2应用程序中做新闻共享功能,我从离子文档中获取此代码,但仍显示错误。
这是qq共享,与新闻文本,图像,音频共享,我也想知道它是离子得到像MOB一样的shareSdk可以与所有平台共享,bcz我也要开发fb,微博,微信。编码太多
news.ts
import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import { NewsDataProvider } from '../../providers/news-data/news-data';
import { QQSDK, QQShareOptions } from '@ionic-native/qqsdk';
@Component({
selector: 'page-news-detail',
templateUrl: 'news-detail.html',
})
export class NewsDetailPage {
new: any;
constructor(public navCtrl: NavController,
public navParams: NavParams,
public newsData:NewsDataProvider,
private qq: QQSDK) {
this.new = navParams.get('new');
}
share(){
this.qq.shareText(shareTextOptions)
.then(() => {
console.log('shareText success');
})
.catch(error => {
console.log(error);
});
this.qq.shareImage(options)
.then(() => {
console.log('shareImage success');
})
.catch(error => {
console.log(error);
});
}
this.qq.shareNews(options)
.then(() => {
console.log('shareNews success');
})
.catch(error => {
console.log(error);
});
}
this.qq.shareAudio(options)
.then(() => {
console.log('shareAudio success');
})
.catch(error => {
console.log(error);
});
}
}
这是我终端中的错误