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

Optional CoreNFC import #395

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@
<header-file src="src/ios/NfcPlugin.h" />
<source-file src="src/ios/NfcPlugin.m" />

<!-- frameworks -->
<framework src="CoreNFC.framework" />
<!-- frameworks- make CoreNFC optional (for backwards compatibility issues)-->
<framework src="CoreNFC.framework" weak="true"/>

<preference name="NFC_USAGE_DESCRIPTION" default="Read NFC Tags" />
<config-file target="*-Info.plist" parent="NFCReaderUsageDescription">
Expand Down
1 change: 1 addition & 0 deletions src/ios/NfcPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
}

// iOS Specific API
- (void)channel:(CDVInvokedUrlCommand *)command;
- (void)beginSession:(CDVInvokedUrlCommand *)command;
- (void)invalidateSession:(CDVInvokedUrlCommand *)command;

Expand Down
5 changes: 5 additions & 0 deletions src/ios/NfcPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ - (void)pluginInitialize {

#pragma mark -= Cordova Plugin Methods

// TODO: Hotfix for https://github.com/chariotsolutions/phonegap-nfc/issues/363
- (void)channel:(CDVInvokedUrlCommand*)command {
NSLog(@"channel :-)");
}

// Unfortunately iOS users need to start a session to read tags
- (void)beginSession:(CDVInvokedUrlCommand*)command {
NSLog(@"beginSession");
Expand Down