mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-04-13 00:00:10 +08:00
docs(nfc): update usage doc of the nfc plugin (#1846)
* docs(nfc): update usage doc of the nfc plugin show an example of how the event listeners work with observable subscription and implement an nfc share within the event listener. * docs(AndroidPermissions): requestPermissions->requestPermission
This commit is contained in:
@@ -23,8 +23,17 @@ declare let window: any;
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* let message = this.ndef.textRecord('Hello world');
|
||||
* this.nfc.share([message]).then(onSuccess).catch(onError);
|
||||
* this.nfc.addNdefListener(() => {
|
||||
* console.log('successfully attached ndef listener');
|
||||
* }, (err) => {
|
||||
* console.log('error attaching ndef listener', err);
|
||||
* }).subscribe((event) => {
|
||||
* console.log('received ndef message. the tag contains: ', event.tag);
|
||||
* console.log('decoded tag id', this.nfc.bytesToHexString(event.tag.id));
|
||||
*
|
||||
* let message = this.ndef.textRecord('Hello world');
|
||||
* this.nfc.share([message]).then(onSuccess).catch(onError);
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user