Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit f29e5c6

Browse files
authored
Merge pull request #500 from NewStore/fix-deprecated-Event-calls
Update deprecated iOS sendEvent method calls
2 parents dd243c4 + a975d13 commit f29e5c6

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

ios/CodePush/CodePush.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
#import "RCTEventEmitter.h"
12
#import <Foundation/Foundation.h>
23

3-
@interface CodePush : NSObject
4+
@interface CodePush : RCTEventEmitter
45

56
+ (NSURL *)binaryBundleURL;
67
/*

ios/CodePush/CodePush.m

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,15 @@ - (void)dealloc
294294
[[NSNotificationCenter defaultCenter] removeObserver:self];
295295
}
296296

297-
- (void)dispatchDownloadProgressEvent
298-
{
299-
// Notify the script-side about the progress
300-
[self.bridge.eventDispatcher
301-
sendDeviceEventWithName:@"CodePushDownloadProgress"
302-
body:@{
303-
@"totalBytes":[NSNumber numberWithLongLong:_latestExpectedContentLength],
304-
@"receivedBytes":[NSNumber numberWithLongLong:_latestReceivedConentLength]
305-
}];
297+
- (void)dispatchDownloadProgressEvent {
298+
// Notify the script-side about the progress
299+
[self sendEventWithName:@"CodePushDownloadProgress"
300+
body:@{
301+
@"totalBytes" : [NSNumber
302+
numberWithLongLong:_latestExpectedContentLength],
303+
@"receivedBytes" : [NSNumber
304+
numberWithLongLong:_latestReceivedConentLength]
305+
}];
306306
}
307307

308308
/*

0 commit comments

Comments
 (0)