响应本机链接sharedLibrarie将lib添加到可选

时间:2017-03-15 02:24:28

标签: react-native

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之后是否有任何配置项将此框架设置为可选?

1 个答案:

答案 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