react-native版本react-native-cli: 0.2.0 react-native: 0.41.2
在rnpm 1.9.0版本https://github.com/rnpm/rnpm/releases/tag/v1.9.0之后
因此,当我公开我的库时,我可以在sharedLibraries中添加库,就像这样
"rnpm": {
"ios": {
"sharedLibraries": [
"libz",
"UserNotifications",
"CoreTelephony",
"Security",
"CFNetwork",
"CoreFoundation",
"SystemConfiguration",
"Foundation",
"UIKit",
"libresolv",
"CoreGraphics"
]
}
}问题是UserNotification.framework仅在iOS 10中可用,因此不能要求它,此框架状态应设置为可选
在react-native link之后,是否有任何配置项可以将此框架设置为可选
发布于 2017-03-15 12:41:13
在你的AppDelegate.h中这样做-
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
#import <UserNotifications/UserNotifications.h>
#endif有关更多信息,请参阅此模块- https://github.com/GetuiLaboratory/react-native-getui/blob/master/example/document/iOS.md
https://stackoverflow.com/questions/42800029
复制相似问题