SocketMobile / singleentryswift-ios

Sample code for ScanAPI SDK using Swift
Other
7 stars 1 forks source link

DeviceInfo.h defines "@protocol Notification" which conflicts with iOS Notification class #4

Closed kafermeister closed 6 years ago

kafermeister commented 7 years ago

Hi,

Attempting to integrate the ScanAPI in an existing project and afterwards I am getting compile conflicts with the standard NSNotification (Notification in Swift) due to DeviceInfo.h declaring a protocol called Notification, i.e.:

/Users/pjr/Documents/Development/iRep/PNA/SPListItem.swift:201:230: 'Notification' is ambiguous for type lookup in this context

Regards Peter

kafermeister commented 7 years ago

Managed to work around the issue by prefixing my Notification usage as "Foundation.Notification" but probably easier if the DeviceInfo protocol was named something else as NSNotification is a commonly used class.

EricGlaenzer commented 7 years ago

That's correct. I think swift renamed their NSNotification to Notification... that's probably why this issue is showing up now. Thank you for reporting this, we are going to address it.

achin-pea commented 6 years ago

@EricGlaenzer - Have you addressed this issue yet? We just updated to Xcode 9.3 and get a build error: "Notification is ambiguous for the type lookup in this context". Two grey exclamation options: "Found this candidate (Foundation.Notification)", or "Found this candidate (ScanAPI.Notification)". We're using Apple's Notification in these cases, and "Foundation.Notification" fixes it, but it would be nice to have a fix.

EricGlaenzer commented 6 years ago

@achin-pea : Thank you for getting back to us about this. We have an updated version of our SDK now called Capture. Moving forward I would recommend to use this version. It is similar in principle with the former ScanAPI SDK, and also a lot simpler to install as it is now fully available from cocoapods.org. (No need to download a newer version from our website and easier to stay up to date with the latest version). Don't hesitate to contact us if you need assistance to move from ScanAPI to Capture using our support email: sdksupport@socketmobile.com.