![](/img/trans.png)
[英]getting message **sharing failed please try again** in ionic app when I try to share link via whatsapp
[英]Ionic 4 + WhatsApp share - Get receiver / contact details after I share my message
我正在使用Ionic 4 + SocialSharing-PhoneGap-Plugin 。
我有以下代碼:
import { SocialSharing } from '@ionic-native/social-sharing/ngx';
constructor(private socialSharing: SocialSharing) { }
// Share message via WhatsApp
this.socialSharing.shareViaWhatsApp('Hi', null, null).then(() => {
// How to get the contact's details here, with whom
// I shared my message? Would like to get the name, number
// and all other contact info.
// Following Toast does not seem to trigger
this.toastService.presentToast('Successfully shared coupon on WhatsApp', 'success');
}).catch(() => {
// Sharing via WhatsApp is not possible. How to trigger a toast here as well?
});
要訪問聯系人,您將需要一個單獨的插件,例如Contacts -也許首先使用該插件獲取聯系人,然后使用shareViaWhatsAppToPhone
直接共享至該號碼。
烤面包應該起作用。 從您的示例來看,您似乎沒有將ToastService
注入到類中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.