0

I want to allow user to subscribe to multiple topics via a list, So if a user select a item on list I want the user to subscribe to that topic and receive notification. Documentation says:

FCMPlugin.subscribeToTopic('topicExample');

But I get

FCMPlugin is not defined

. I am able to send notifications to default topics. I am using in Ionic V1.

1 Answers1

0

Be sure to access the FCMPlugin object after the device-ready event:

$ionicPlatform.ready(function() {
    FCMPlugin.subscribeToTopic('topicExample');
});

It's a bit tedious, but I tend to trace these errors by logging to console the status of the object along the flow of the program:

console.debug('defined?: ' + typeof(FCMPlugin));

For other debugging strategies see: https://stackoverflow.com/a/41744948/1786341

  • yeah... I just discovered it last week. and works fine... wish I could find this earlier would have saved huge amount of time. thanks by the way – omkar khalipe Aug 03 '17 at 06:52