Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 1 addition & 28 deletions ios/RNAppMetadata.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,6 @@ - (dispatch_queue_t)methodQueue
RCT_EXPORT_MODULE()

- (NSDictionary *)constantsToExport {
NSString *iosVersion = [[UIDevice currentDevice] systemVersion];
NSString *infoDeviceName = [[UIDevice currentDevice] name];

return @{
@"Version": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"],
@"ShortVersion": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"],
@"BundleIdentifier": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"],
@"BundleName": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"],
};
}

RCT_REMAP_METHOD(getAppMetadataBy,
key: (NSString*)key
resolver: (RCTPromiseResolveBlock)resolve
rejecter: (RCTPromiseRejectBlock) reject) {
NSString* value = nil;
value = [[NSBundle mainBundle] objectForInfoDictionaryKey: key];
if (value) {
resolve(value);
} else {
NSError *err = [NSError errorWithDomain:@"RNAppMetadata"
code:1
userInfo:@{
NSLocalizedDescriptionKey:@"There is no such key"
}];
reject(@"key_not_found", @"There is no such key", err);
}
return [NSBundle mainBundle].infoDictionary;
}
@end

20 changes: 5 additions & 15 deletions ios/RNAppMetadata.podspec
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@

Pod::Spec.new do |s|
s.name = "RNAppMetadata"
s.version = "1.0.0"
s.summary = "RNAppMetadata"
s.description = <<-DESC
RNAppMetadata
DESC
s.homepage = ""
s.description = "Get app metadata from Info.plist (iOS) or AndroidManifest.xml (android)"
s.homepage = "https://github.com/CubeSugar/react-native-app-metadata"
s.license = "MIT"
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
s.author = { "author" => "author@domain.cn" }
s.author = { "author" => "author@domain.cn" }
s.platform = :ios, "7.0"
s.source = { :git => "https://github.com/author/RNAppMetadata.git", :tag => "master" }
s.source_files = "RNAppMetadata/**/*.{h,m}"
s.source = { :git => "https://github.com/CubeSugar/react-native-app-metadata.git", :tag => "v1.0.0" }
s.source_files = "*.{h,m}"
s.requires_arc = true


s.dependency "React"
#s.dependency "others"

end