本文整理匯總了TypeScript中@ionic-native/social-sharing.SocialSharing類的典型用法代碼示例。如果您正苦於以下問題:TypeScript SocialSharing類的具體用法?TypeScript SocialSharing怎麽用?TypeScript SocialSharing使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了SocialSharing類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: shareInsta
shareInsta() {
this.socialSharing.shareViaInstagram(this.post.post_title, this.post.link_imagem).then(() => {
// Success!
}).catch(() => {
// Error!
});
}
示例2: shareFb
shareFb() {
this.socialSharing.shareViaFacebook(this.post.guid).then(() => {
// Success!
}).catch(() => {
// Error!
});
}
示例3: shareWhatsapp
public shareWhatsapp() {
if (!this.whatsapp) {
this.showError();
return;
}
this.socialSharing.shareViaWhatsApp(this.downloadUrl);
}
示例4: shareWp
shareWp() {
this.socialSharing.shareViaWhatsApp(this.post.guid).then(() => {
// Success!
}).catch(() => {
// Error!
});
}
示例5: shareTt
shareTt() {
this.socialSharing.shareViaTwitter(this.post.guid).then(() => {
// Success!
}).catch(() => {
// Error!
});
}
示例6: ionViewWillEnter
ionViewWillEnter() {
this.socialSharing
.canShareVia('com.apple.social.facebook', 'msg', null, null, null)
.then(() => {
this.shareFacebookVia = 'com.apple.social.facebook';
this.facebook = true;
})
.catch(() => {
this.socialSharing
.canShareVia('com.facebook.katana', 'msg', null, null, null)
.then(() => {
this.shareFacebookVia = 'com.facebook.katana';
this.facebook = true;
})
.catch(e => {
this.logger.error('facebook error: ' + e);
this.facebook = false;
});
});
this.socialSharing
.canShareVia('com.apple.social.twitter', 'msg', null, null, null)
.then(() => {
this.shareTwitterVia = 'com.apple.social.twitter';
this.twitter = true;
})
.catch(() => {
this.socialSharing
.canShareVia('com.twitter.android', 'msg', null, null, null)
.then(() => {
this.shareTwitterVia = 'com.twitter.android';
this.twitter = true;
})
.catch(e => {
this.logger.error('twitter error: ' + e);
this.twitter = false;
});
});
this.socialSharing
.canShareVia('whatsapp', 'msg', null, null, null)
.then(() => {
this.whatsapp = true;
})
.catch(e => {
this.logger.error('whatsapp error: ' + e);
this.whatsapp = false;
});
}
示例7:
}).catch((e) => {
this.socialSharing.canShareVia('com.twitter.android', 'msg', null, null, null).then(() => {
this.shareTwitterVia = 'com.twitter.android';
this.twitter = true;
}).catch((e) => {
this.logger.debug('twitter error: ' + e);
this.twitter = false;
});
});
示例8:
]).subscribe(translations => {
this.socialSharing.shareViaEmail(
translations["SETTINGS.FEEDBACK.EMAIL.FEATURE"],
translations["SETTINGS.FEEDBACK.EMAIL.FEATURE_TITLE"],
["methoappeei@gmail.com"],
[],
[],
null
);
});
示例9: shareItem
shareItem(item) {
const params = {
text: item.hasOwnProperty('description') ? Utils.striptags(Utils.br2nl(item.description)) : null,
title: item.hasOwnProperty('title') ? Utils.striptags(Utils.br2nl(item.title)) : null,
files: [],
url: item.hasOwnProperty('link') ? item.link : null
};
if (item.thumbnails && item.thumbnails.length > 0) {
params.files.push(item.thumbnails[0].url);
}
return this.socialSharing.shareWithOptions(params);
}