2.0.0 • Published 12 months ago
capacitor-share-extension v2.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);
}
3.0.0-beta.0
12 months ago
1.1.0
2 years ago
2.0.0
2 years ago
0.1.0
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago
1.0.1-beta.0
2 years ago
1.1.0-beta.0
2 years ago
0.0.20
3 years ago
0.0.19
3 years ago
0.0.18
4 years ago
0.0.17
4 years ago
0.0.16
5 years ago
0.0.15
5 years ago
0.0.14
5 years ago
0.0.13
5 years ago
0.0.12
5 years ago
0.0.11
5 years ago
0.0.10
5 years ago
0.0.9
5 years ago
0.0.8
5 years ago
0.0.7
5 years ago
0.0.6
5 years ago
0.0.5
5 years ago
0.0.4
5 years ago
0.0.3
5 years ago
0.0.2
5 years ago
0.0.1
5 years ago