我无法使用@ionic-native/social-sharing
与Facebook分享。这是我的.ts
文件。
import { Component } from '@angular/core';
import { SocialSharing } from '@ionic-native/social-sharing';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
img: String = 'https://static.guim.co.uk/sys-images/Guardian/Pix/pictures/2011/1/12/1294859657274/Earth-007.jpg'
result: any
reason: any
constructor(public sharing: SocialSharing) { }
fb() {
this.sharing.shareViaFacebook(msg, img, url)
.then((result: any) => {
this.result = result
})
.catch((reason: any) => {
this.reason = reason
})
}
}
执行fb()
函数时,它使用此catch
击中reason
:
[
"com.android.bluetooth",
"com.android.nfc",
"com.google.android.apps.docs",
"com.google.android.apps.docs",
"com.google.android.apps.messaging",
"com.google.android.apps.translate",
"com.google.android.gm",
"com.google.android.talk",
"com.verizon.messaging.vzmsgs",
"com.estmob.android.sendanywhere",
"com.facebook.orca",
"com.skype.raider",
"nextapp.fx"
]
通过电子邮件共享可以正常工作。通过Twitter共享也不起作用-使用此reason
:
[
"com.amazon.kindle",
"com.android.bluetooth",
"com.android.nfc",
"com.google.android.apps.docs",
"com.google.android.apps.maps",
"com.google.android.apps.messaging",
"com.google.android.apps.photos",
"com.google.android.gm",
"com.google.android.talk",
"com.vcast.mediamanager",
"com.vcast.mediamanager",
"com.verizon.messaging.vzmsgs",
"com.estmob.android.sendanywhere",
"com.facebook.orca",
"com.google.android.street",
"com.skype.raider",
"nextapp.fx"
]