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] + }]; } /*