From b4eafee5658692648e1e2500f2ab36d798f5067e Mon Sep 17 00:00:00 2001 From: Elad Gil Date: Tue, 24 Apr 2018 12:13:08 +0300 Subject: [PATCH] forgot task config --- .../project.pbxproj | 4 +- ios/TaskConfig.h | 51 +++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 ios/TaskConfig.h diff --git a/ios/RNBackgroundDownload.xcodeproj/project.pbxproj b/ios/RNBackgroundDownload.xcodeproj/project.pbxproj index bb11963..85f0d4c 100644 --- a/ios/RNBackgroundDownload.xcodeproj/project.pbxproj +++ b/ios/RNBackgroundDownload.xcodeproj/project.pbxproj @@ -24,6 +24,7 @@ /* Begin PBXFileReference section */ 134814201AA4EA6300B7C361 /* libRNBackgroundDownload.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNBackgroundDownload.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 565BF70F208F2C7C00F66231 /* TaskConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TaskConfig.h; sourceTree = ""; }; B3E7B5881CC2AC0600A0062D /* RNBackgroundDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNBackgroundDownload.h; sourceTree = ""; }; B3E7B5891CC2AC0600A0062D /* RNBackgroundDownload.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNBackgroundDownload.m; sourceTree = ""; }; /* End PBXFileReference section */ @@ -50,6 +51,7 @@ 58B511D21A9E6C8500147676 = { isa = PBXGroup; children = ( + 565BF70F208F2C7C00F66231 /* TaskConfig.h */, B3E7B5881CC2AC0600A0062D /* RNBackgroundDownload.h */, B3E7B5891CC2AC0600A0062D /* RNBackgroundDownload.m */, 134814211AA4EA7D00B7C361 /* Products */, @@ -197,7 +199,7 @@ isa = XCBuildConfiguration; buildSettings = { HEADER_SEARCH_PATHS = ( - "$(inherited)", + "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../../../React/**", "$(SRCROOT)/../../react-native/React/**", diff --git a/ios/TaskConfig.h b/ios/TaskConfig.h new file mode 100644 index 0000000..e9ad809 --- /dev/null +++ b/ios/TaskConfig.h @@ -0,0 +1,51 @@ +// +// TaskConfig.h +// EkoApp +// +// Created by Elad Gil on 21/11/2017. +// Copyright © 2017 Eko. All rights reserved. +// + +#import + +@interface TaskConfig : NSObject + +@property NSString * _Nonnull id; +@property NSString * _Nonnull destination; +@property BOOL reportedBegin; + +- (id _Nullable )initWithDictionary: (NSDictionary *_Nonnull)dict; + +@end + +@implementation TaskConfig + +- (id _Nullable )initWithDictionary: (NSDictionary *_Nonnull)dict { + self = [super init]; + if (self) { + self.id = dict[@"id"]; + self.destination = dict[@"destination"]; + self.reportedBegin = NO; + } + + return self; +} + +- (void)encodeWithCoder:(nonnull NSCoder *)aCoder { + [aCoder encodeObject:self.id forKey:@"id"]; + [aCoder encodeObject:self.destination forKey:@"destination"]; + [aCoder encodeBool:self.reportedBegin forKey:@"reportedBegin"]; +} + +- (nullable instancetype)initWithCoder:(nonnull NSCoder *)aDecoder { + self = [super init]; + if (self) { + self.id = [aDecoder decodeObjectForKey:@"id"]; + self.destination = [aDecoder decodeObjectForKey:@"destination"]; + self.reportedBegin = [aDecoder decodeBoolForKey:@"reportedBegin"]; + } + + return self; +} + +@end