MCPcopy
hub / github.com/bitpay/wallet / shareIOS

Method shareIOS

src/providers/logs/logs.ts:86–120  ·  view source on GitHub ↗
(message, subject, attachment)

Source from the content-addressed store, hash-verified

84 }
85
86 private shareIOS(message, subject, attachment): void {
87 // Check if sharing via email is supported
88 this.socialSharing
89 .canShareViaEmail()
90 .then(() => {
91 this.logger.info('sharing via email is possible');
92 this.socialSharing
93 .shareViaEmail(
94 message,
95 subject,
96 null, // TO: must be null or an array
97 null, // CC: must be null or an array
98 null, // BCC: must be null or an array
99 attachment // FILES: can be null, a string, or an array
100 )
101 .then(data => {
102 this.logger.info('Email created successfully: ', data);
103 })
104 .catch(err => {
105 this.logger.error('socialSharing Error: ', err);
106 });
107 })
108 .catch(() => {
109 this.logger.warn('sharing via email is not possible');
110 this.socialSharing
111 .share(
112 message,
113 subject,
114 attachment // FILES: can be null, a string, or an array
115 )
116 .catch(err => {
117 this.logger.error('socialSharing Error: ', err);
118 });
119 });
120 }
121}

Callers 1

shareMethod · 0.95

Calls 4

infoMethod · 0.80
errorMethod · 0.80
warnMethod · 0.80
shareMethod · 0.80

Tested by

no test coverage detected