From a975d13a46f1dfbda2e6db4c29e7ae7bed1a8f99 Mon Sep 17 00:00:00 2001 From: Felix Sammet Date: Mon, 8 Aug 2016 10:20:33 +0200 Subject: [PATCH] fix(ios): update deprecated method call --- ios/CodePush/CodePush.h | 3 ++- ios/CodePush/CodePush.m | 18 +++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ios/CodePush/CodePush.h b/ios/CodePush/CodePush.h index feef97a..07af513 100644 --- a/ios/CodePush/CodePush.h +++ b/ios/CodePush/CodePush.h @@ -1,6 +1,7 @@ +#import "RCTEventEmitter.h" #import -@interface CodePush : NSObject +@interface CodePush : RCTEventEmitter + (NSURL *)binaryBundleURL; /* diff --git a/ios/CodePush/CodePush.m b/ios/CodePush/CodePush.m index e6616ab..922f60e 100644 --- a/ios/CodePush/CodePush.m +++ b/ios/CodePush/CodePush.m @@ -269,15 +269,15 @@ static NSString *bundleResourceSubdirectory = nil; [[NSNotificationCenter defaultCenter] removeObserver:self]; } -- (void)dispatchDownloadProgressEvent -{ - // Notify the script-side about the progress - [self.bridge.eventDispatcher - sendDeviceEventWithName:@"CodePushDownloadProgress" - body:@{ - @"totalBytes":[NSNumber numberWithLongLong:_latestExpectedContentLength], - @"receivedBytes":[NSNumber numberWithLongLong:_latestReceivedConentLength] - }]; +- (void)dispatchDownloadProgressEvent { + // Notify the script-side about the progress + [self sendEventWithName:@"CodePushDownloadProgress" + body:@{ + @"totalBytes" : [NSNumber + numberWithLongLong:_latestExpectedContentLength], + @"receivedBytes" : [NSNumber + numberWithLongLong:_latestReceivedConentLength] + }]; } /*