Authored by 盖剑秋

Add native module 'privateKey' to ios project. Reviewer: Yu Liang.

... ... @@ -12,6 +12,7 @@
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
2EDB1CE11CFED97B001CA832 /* RNNativeConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EDB1CE01CFED97B001CA832 /* RNNativeConfig.m */; };
5AC1B39F4940B0FAC56474FA /* libPods-YH_Vendor.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B562CE3CB8E496AF9768090D /* libPods-YH_Vendor.a */; };
87AF818B1CFD959D00ACE834 /* libRNDeviceInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 87AF818A1CFD959D00ACE834 /* libRNDeviceInfo.a */; };
/* End PBXBuildFile section */
... ... @@ -39,6 +40,8 @@
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = YH_Vendor/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = YH_Vendor/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = YH_Vendor/main.m; sourceTree = "<group>"; };
2EDB1CDF1CFED97B001CA832 /* RNNativeConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNNativeConfig.h; sourceTree = "<group>"; };
2EDB1CE01CFED97B001CA832 /* RNNativeConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNativeConfig.m; sourceTree = "<group>"; };
5B51D3B6F0CB3E5047D881CA /* Pods-YH_Vendor.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YH_Vendor.debug.xcconfig"; path = "Pods/Target Support Files/Pods-YH_Vendor/Pods-YH_Vendor.debug.xcconfig"; sourceTree = "<group>"; };
87AF818A1CFD959D00ACE834 /* libRNDeviceInfo.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libRNDeviceInfo.a; path = "../../../../Library/Developer/Xcode/DerivedData/YH_Vendor-hikjhmoukakxyvegrfxjqofhevhj/Build/Products/Release-iphonesimulator/libRNDeviceInfo.a"; sourceTree = "<group>"; };
B562CE3CB8E496AF9768090D /* libPods-YH_Vendor.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-YH_Vendor.a"; sourceTree = BUILT_PRODUCTS_DIR; };
... ... @@ -91,6 +94,7 @@
13B07FB61A68108700A75B9A /* Info.plist */,
13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
13B07FB71A68108700A75B9A /* main.m */,
2EDB1CDE1CFED96B001CA832 /* RNNativeConfig */,
);
name = YH_Vendor;
sourceTree = "<group>";
... ... @@ -104,6 +108,16 @@
name = Pods;
sourceTree = "<group>";
};
2EDB1CDE1CFED96B001CA832 /* RNNativeConfig */ = {
isa = PBXGroup;
children = (
2EDB1CDF1CFED97B001CA832 /* RNNativeConfig.h */,
2EDB1CE01CFED97B001CA832 /* RNNativeConfig.m */,
);
name = RNNativeConfig;
path = YH_Vendor/RNNativeConfig;
sourceTree = "<group>";
};
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup;
children = (
... ... @@ -313,6 +327,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2EDB1CE11CFED97B001CA832 /* RNNativeConfig.m in Sources */,
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
13B07FC11A68108700A75B9A /* main.m in Sources */,
);
... ...
//
// RNNativeConfig.h
// YH_Vendor
//
// Created by 盖剑秋 on 16/6/1.
// Copyright © 2016年 Facebook. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "RCTBridgeModule.h"
@interface RNNativeConfig : NSObject <RCTBridgeModule>
@end
... ...
//
// RNNativeConfig.m
// YH_Vendor
//
// Created by 盖剑秋 on 16/6/1.
// Copyright © 2016年 Facebook. All rights reserved.
//
#import "RNNativeConfig.h"
@implementation RNNativeConfig
RCT_EXPORT_MODULE()
- (NSDictionary *)constantsToExport {
return @{
@"privateKey":@"a85bb0674e08986c6b115d5e3a4884fa",
};
}
@end
... ...
'use strict';
// let RNNativeConfig = require('react-native').NativeModules.RNNativeConfig;
let RNNativeConfig = require('react-native').NativeModules.RNNativeConfig;
/**
*
... ... @@ -8,7 +8,7 @@
*
*/
function getPrivateKey() {
// return RNNativeConfig.privateKey;
return RNNativeConfig.privateKey;
}
module.exports = {
... ...