我正在使用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?
});
- 如何在返回后立即显示敬酒消息,以便我知道消息已成功分享?从代码中可以看出,我有一个显示 toast 的 toastService,但它永远不会被触发。在成功和错误情况下,如何在 WhatsApp 上成功分享我的消息后触发 toast?