cordova - 无法使用 ionic cordova 社交分享插件分享到 Facebook
问题描述
我无法使用@ionic-native/social-sharing
. 这是我的.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
使用 this命中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"
]
解决方案
推荐阅读
- android - 未能停止媒体复用器
- firebase - Firebase 身份验证和 Caledar API
- php - PHP openssl AES-256-ECB 与 IV
- javascript - 显示数组中的随机内容
- node.js - 如何使用事务或批处理来读取更新的值,然后使用该值执行更多更新?
- arrays - 从数组中显示带有名称的随机图像。(斯威夫特用户界面)
- javascript - 尝试从 json 文件中获取数据时出现问题
- wordpress - 如何在wordpress中编辑隐藏表单
- python - Django:生产中的登录/密码管理?
- node.js - 无法从 lambda 函数的 dynamodb 获取数据