3.0.0 • Published 1 year ago
capacitor-share-extension v3.0.0
@calvinckho/capacitor-share-extension
This Capacitor Plugin provides native capabilities to retrieve media files sent via iOS Share Extension and Android Send Intent events
Installation
npm i git+ssh://git@github.com/calvinckho/capacitor-share-extension
Capacitor 3 Usage
import { ShareExtension } from 'capacitor-share-extension';
if (this.platform.is('cordova') && Capacitor.isPluginAvailable('ShareExtension')) {
window.addEventListener('sendIntentReceived', () => {
this.checkIntent();
});
this.checkIntent();
}
async checkIntent() {
try {
const result: any = await ShareExtension.checkSendIntentReceived();
if (result && result.type) {
console.log('Intent received: ', JSON.stringify(result));
}
} catch (err) {
console.log(err);
}
}
// in Android, call finish when done processing the Intent
await ShareExtension.finish()
// iOS keychain methods
try {
// load an authentication token
const token = 'token XXYYZZ';
// use the extension to save the auth token to iOS Keychain
await ShareExtension.saveDataToKeychain({ key: 'token', data: token });
} catch (err) {
console.log(err);
}
// when user is about to log out, remove the token from iOS Keychain
try {
await ShareExtension.clearKeychainData( { key: 'token' });
} catch (err) {
console.log(err);
}
4.0.0-beta-0
1 year ago
4.0.0-beta.0
1 year ago
3.0.0
1 year ago
3.0.0-beta.0
2 years ago
1.1.0
3 years ago
2.0.0
3 years ago
0.1.0
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago
1.0.1-beta.0
3 years ago
1.1.0-beta.0
3 years ago
0.0.20
4 years ago
0.0.19
4 years ago
0.0.18
5 years ago
0.0.17
5 years ago
0.0.16
6 years ago
0.0.15
6 years ago
0.0.14
6 years ago
0.0.13
6 years ago
0.0.12
6 years ago
0.0.11
6 years ago
0.0.10
6 years ago
0.0.9
6 years ago
0.0.8
6 years ago
0.0.7
6 years ago
0.0.6
6 years ago
0.0.5
6 years ago
0.0.4
6 years ago
0.0.3
6 years ago
0.0.2
6 years ago
0.0.1
6 years ago