Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NFC plugin? #412

Closed
marcalj opened this issue Aug 8, 2016 · 11 comments
Closed

NFC plugin? #412

marcalj opened this issue Aug 8, 2016 · 11 comments

Comments

@marcalj
Copy link

marcalj commented Aug 8, 2016

I couldn't find any reference fro NFC support on Ionic Native. It is supported? There's a way to use it?

PD: If not, can be used in Ionic v1?

Thanks! :)

@ihadeed
Copy link
Collaborator

ihadeed commented Aug 9, 2016

That would be this plugin: https://github.com/chariotsolutions/phonegap-nfc

We can definitely add a wrapper for it.

@ihadeed ihadeed added this to the v1.3.13 milestone Aug 11, 2016
ihadeed added a commit that referenced this issue Aug 15, 2016
@ihadeed
Copy link
Collaborator

ihadeed commented Aug 15, 2016

So I was just writing a wrapper for the plugin and I noticed it could be done in two ways.

  1. Return an observable that connects with the callback parameter, and have two optional parameters for onSuccess and onError
  2. Return a promise and have a required parameter of callback

See here: 82ccf13

I think the first option makes more sense, but I would like to know what you think.

CC: @mlynch @mhartington

@amuramoto
Copy link
Contributor

+1 on the first option. Observable seems to be in line with how other wrappers implement this type of thing.

@ihadeed ihadeed removed this from the v1.3.13 milestone Aug 17, 2016
@ihadeed ihadeed self-assigned this Aug 21, 2016
ihadeed added a commit that referenced this issue Aug 27, 2016
* feat(nfc): add nfc plugin

addresses #412

* feat(nfc): add nfc support
@ihadeed ihadeed closed this as completed Aug 27, 2016
@csernam
Copy link

csernam commented Sep 19, 2016

This import is not working in Ionic2 beta11. Ionic-native/dist/index has no exported member 'NFC'

import {NFC, Ndef} from 'ionic-native';

If I open and look for 'nfc' into Ionic-native/dist/index.js & index.d.ts, there is no reference to it.
I neither can find any plugin related to NFC into node_modules/ionic-native/dist/plugins directory.

I'm trying to work with the example from http://ionicframework.com/docs/v2/native/nfc/

Could anybody help me?

Thanks

@mhartington
Copy link
Contributor

@bokgeek did you update the installed package of ionic-native? Check your package.json, please make sure you have the most recent version.

@csernam
Copy link

csernam commented Sep 20, 2016

Thanks a lot @mhartington, that was the issue.
I can't even read a label but that's another story... I keep trying.


Finally I did it!
If there are someone interested, check this repository

@lehrenberg
Copy link
Contributor

Hi folks, the phonegap-nfc plugin supports iOS now by adding two additional functions (beginSession & invalidateSession). Is there a way to implement those in the ionic native wrapper so people can use NFC for iOS with Ionic?

@mhartington
Copy link
Contributor

@lehrenberg it should be possible to just add the 2 additional method to the class. If you're up for sending a Pull Request to add them, I'd be more than happy to walk you through it and merge it!

@lehrenberg
Copy link
Contributor

lehrenberg commented Oct 18, 2017

@mhartington So I just added the two methods. Not sure if this 100% correct though. Actually never contributed before... The pull request is #2050

@rayron
Copy link

rayron commented Oct 19, 2018

Hi guys, I have noticed that the ionic-native nfc does not support the invalidateSession function.
I can scan nfc on my app but the invalidateSession cannot be called so the control does not return back to the ionic app?
Any suggestions or solutions would be excellent.
Thanks

@danielsogl
Copy link
Owner

Please create a new Issue.

Repository owner locked as resolved and limited conversation to collaborators Oct 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants