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.beginSession not opening the dialogue over the app #283

Closed
andyj opened this issue Sep 27, 2017 · 13 comments
Closed

nfc.beginSession not opening the dialogue over the app #283

andyj opened this issue Sep 27, 2017 · 13 comments

Comments

@andyj
Copy link

andyj commented Sep 27, 2017

First question: Does anyone have this working at all?

My issue: I've created a blank PhoneGap app with a single button on the page

<button id="iosNfcButton" href="##">ios nfc</button>

I have a listener

document.getElementById('swipeTag').addEventListener("click",iosNFC,false);

And a function

function iosNFC(){
  nfc.beginSession(
    function(){console.log("Success");},
    function(){console.log("ERROR");}
  );
}

When the button is clicked it appears that it doesn't work. What is actually happening is that the "Ready To Scan" box isn't coming up over the app and taking focus. The way I found out it was there (by accident) was to double click the home button to switch away and then it takes focus. At that point the swipe works and return back to the app.

Is this an iOS issue, plugin issue or phone app problem?

If anyone has it working could they share what their repo?

@don
Copy link
Member

don commented Oct 3, 2017

@andyj are you still seeing this? What version of iOS are you using?

Can you share a project on GitHub so I can try to duplicate on my hardware?

@andyj
Copy link
Author

andyj commented Oct 3, 2017

Version 11.0.1 (15A403)
iPhone 8+ ( if that changes anything?)

@don
Copy link
Member

don commented Oct 3, 2017

I was hoping 11.0.1 might have fixed the issue. Can you share a simple project? I haven't been able to duplicate this.

@andyj
Copy link
Author

andyj commented Oct 3, 2017

I've just created https://github.com/andyj/iosnfc

@JohnMcLear
Copy link
Contributor

I don't experience this bug, weird one.. If you create the project with cordova do you get the same experience?

I tested on iPhone 7 & 8. Not sure on version.

@andyj
Copy link
Author

andyj commented Oct 3, 2017

I’ll try Cordova tonight. My only thought is that an Xcode setting is affecting it?

@andyj
Copy link
Author

andyj commented Oct 3, 2017

@JohnMcLear thank you for pointing me at Cordova. Works fine. The problem then is Phonegap, my installed version is up to date with the current releases too.

@JohnMcLear
Copy link
Contributor

JohnMcLear commented Oct 3, 2017 via email

@andyj andyj closed this as completed Oct 4, 2017
@JoshuaPerk
Copy link

@andyj I seem to be having an issue that appears to be rooted in the same vein. I took your repo and added platform ios in cordova, then built, and ran it on my device via xcode. I hit the button and nothing seems to happen (other than the "NFC button hit" text). I had to add a few Capabilities in order to compile, but I'm not quite sure what I'm missing... (iPhone 7).

@JoshuaPerk
Copy link

@andyj I was in-fact able to get it sort-of working. Running into the same issue though. Doesn't pop up until I double click the home button... No idea why...

@JoshuaPerk
Copy link

JoshuaPerk commented Dec 29, 2017

@don @JohnMcLear, are you aware of any xCode settings or quarks with NFC Core or the plugin implementation that would be causing the following? I've rebuilt in the most recent Cordova and PhoneGap to no avail.

https://youtu.be/LwilT02EFxg

@andyj, I'm assuming the above is what you experienced?

@JohnMcLear
Copy link
Contributor

I don't, sorry! I'd offer to try build for you but I'm not at my iOS build environment for another month or so.

@JoshuaPerk
Copy link

I greatly appreciate the notion; no worries! I believe the issue was (oddly enough) tied directly to the CSP tag. My CSP settings were preventing the dialogue modal from appearing. When I exited the app (and my CSP rules were no longer in place), the modal executed.

Happy New Year!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants