diff --git a/ios/CodePush/CodePush.h b/ios/CodePush/CodePush.h index 5174f1a..b600278 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 152b9df..b3335d4 100644 --- a/ios/CodePush/CodePush.m +++ b/ios/CodePush/CodePush.m @@ -294,15 +294,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] + }]; } /*