Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
🐛🍎 Issue #1461: App crashes when initialising with topics (v2.0.0-rc1)
Browse files Browse the repository at this point in the history
  • Loading branch information
macdonst committed May 4, 2017
1 parent 6404411 commit 8f827a9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ios/PushPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ -(void)initRegistration;
if (topics != nil) {
for (NSString *topic in topics) {
NSLog(@"subscribe from topic: %@", topic);
id pubSub = [FIRInstanceID instanceID];
id pubSub = [FIRMessaging messaging];
[pubSub subscribeToTopic:[NSString stringWithFormat:@"/topics/%@", topic]];
}
}
Expand Down Expand Up @@ -112,7 +112,7 @@ - (void)unregister:(CDVInvokedUrlCommand*)command;
NSArray* topics = [command argumentAtIndex:0];

if (topics != nil) {
id pubSub = [FIRInstanceID instanceID];
id pubSub = [FIRMessaging messaging];
for (NSString *topic in topics) {
NSLog(@"unsubscribe from topic: %@", topic);
[pubSub unsubscribeFromTopic:topic];
Expand All @@ -129,7 +129,7 @@ - (void)subscribe:(CDVInvokedUrlCommand*)command;

if (topic != nil) {
NSLog(@"subscribe from topic: %@", topic);
id pubSub = [FIRInstanceID instanceID];
id pubSub = [FIRMessaging messaging];
[pubSub subscribeToTopic:[NSString stringWithFormat:@"/topics/%@", topic]];
NSLog(@"Successfully subscribe to topic %@", topic);
[self successWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Successfully subscribe to topic %@", topic]];
Expand All @@ -145,7 +145,7 @@ - (void)unsubscribe:(CDVInvokedUrlCommand*)command;

if (topic != nil) {
NSLog(@"unsubscribe from topic: %@", topic);
id pubSub = [FIRInstanceID instanceID];
id pubSub = [FIRMessaging messaging];
[pubSub unsubscribeFromTopic:[NSString stringWithFormat:@"/topics/%@", topic]];
NSLog(@"Successfully unsubscribe to topic %@", topic);
[self successWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Successfully unsubscribe from topic %@", topic]];
Expand Down

0 comments on commit 8f827a9

Please sign in to comment.