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

Method share

src/providers/logs/logs.ts:55–76  ·  view source on GitHub ↗
(app, platform)

Source from the content-addressed store, hash-verified

53 }
54
55 private share(app, platform): void {
56 const logs = this.prepareSessionLogs();
57 const now = new Date().toISOString();
58 const subject: string = app + '-logs ' + now;
59 const message =
60 'Session Logs. Be careful, this could contain sensitive private data';
61
62 const blob = new Blob([logs], { type: 'text/txt' });
63
64 const reader = new FileReader();
65 reader.onload = event => {
66 const attachment = (event as any).target.result; // <-- data url
67
68 if (platform == 'android') {
69 this.shareAndroid(message, subject, attachment);
70 } else {
71 this.shareIOS(message, subject, attachment);
72 }
73 };
74
75 reader.readAsDataURL(blob);
76 }
77
78 private shareAndroid(message, subject, attachment): void {
79 // share via email with attachment is not working correctly in some android versions

Callers 11

getMethod · 0.95
shareAndroidMethod · 0.80
shareIOSMethod · 0.80
initMethod · 0.80
shareAddressMethod · 0.80
shareAddressMethod · 0.80
sendByEmailMethod · 0.80
sendWalletBackupMethod · 0.80
printCordovaMethod · 0.80
shareCodeMethod · 0.80
shareAddressMethod · 0.80

Calls 3

prepareSessionLogsMethod · 0.95
shareAndroidMethod · 0.95
shareIOSMethod · 0.95

Tested by

no test coverage detected