问题
I am working on an iOS app in Xcode 8.2.1 using Swift 3.0. I'd like for this app to be able to receive remote push notifications using Microsoft Azure. However, I'm having trouble implementing this. Most guides I've found are for older versions of Swift and don't work anymore.
The only one I was able to find for version 3.0 is this one. However, this doesn't seem to work either. I followed the guide, but got the following error:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_AEIdfaProvider", referenced from:
objc-class-ref in libengagement.a(AEDeviceIDManager.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I believe the class AEIdfaProvider could not be found, even though it is included in the project.
If anyone could give a clue as to how to resolve this, or if there is another guide I could give a shot, I'd be happy to hear it!
回答1:
You are trying to use Objective-C lib in a Swift project.
That's why you should also add that class to a Bridging Header file.
Microsoft has step-by-step tutorial of how to use their Mobile Engagement SDK, see steps #6,#7,#8 there from the Connect your app to the Mobile Engagement backend document chapter.
So check your Bridging Header file for AEIdfaProvider existence in it.
Also important - be sure to link libengagement.a library, check it as well.
来源:https://stackoverflow.com/questions/42958462/microsoft-azure-remote-notifications-in-swift-3