Skip to content

Commit 89c54ad

Browse files
authored
Merge pull request #965 from huangshuni/master
iOS 修复jpush的代理设置问题。
2 parents 47c8764 + 7f518ab commit 89c54ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ios/RCTJPushModule/RCTJPushModule.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,13 @@ - (id)init
147147
if (@available(iOS 12.0, *)) {
148148
entity.types = JPAuthorizationOptionAlert|JPAuthorizationOptionBadge|JPAuthorizationOptionSound|JPAuthorizationOptionProvidesAppNotificationSettings;
149149
}
150-
[JPUSHService registerForRemoteNotificationConfig:entity delegate:self.bridge.delegate];
150+
[JPUSHService registerForRemoteNotificationConfig:entity delegate:[[UIApplication sharedApplication] delegate]];
151151
[launchOptions objectForKey: UIApplicationLaunchOptionsRemoteNotificationKey];
152152
// 自定义消息
153153
NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
154-
[defaultCenter addObserver:self.bridge.delegate selector:@selector(networkDidReceiveMessage:) name:kJPFNetworkDidReceiveMessageNotification object:nil];
154+
[defaultCenter addObserver:[[UIApplication sharedApplication] delegate] selector:@selector(networkDidReceiveMessage:) name:kJPFNetworkDidReceiveMessageNotification object:nil];
155155
// 地理围栏
156-
[JPUSHService registerLbsGeofenceDelegate:self.bridge.delegate withLaunchOptions:launchOptions];
156+
[JPUSHService registerLbsGeofenceDelegate:[[UIApplication sharedApplication] delegate] withLaunchOptions:launchOptions];
157157
// 应用内消息
158158
[JPUSHService setInAppMessageDelegate:self];
159159
});

0 commit comments

Comments
 (0)