react-native版本 react-native-cli:0.2.0 反应原生:0.41.2
在rnpm 1.9.0版本https://github.com/rnpm/rnpm/releases/tag/v1.9.0
之后因此,当我公开我的lib时,我可以在sharedLibraries中添加lib,就像那样
"rnpm": {
"ios": {
"sharedLibraries": [
"libz",
"UserNotifications",
"CoreTelephony",
"Security",
"CFNetwork",
"CoreFoundation",
"SystemConfiguration",
"Foundation",
"UIKit",
"libresolv",
"CoreGraphics"
]
}
}
问题是UserNotification.framework仅在iOS 10中可用,因此无法使用,此框架状态应设置为可选
在react-native link
之后是否有任何配置项将此框架设置为可选?
答案 0 :(得分:0)
在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