fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
623 stars 999 forks source link

Do I have to use topics? #392

Open cheike569 opened 7 years ago

cheike569 commented 7 years ago

Hi,

I am using Ionic 2 with cordova-plugin-fcm. However, after a lot of trouble walking through the ionic documentation finding out they are shutting down their ionic push service, I ended up using this sleek plugin.

In my app.component.ts I am calling:

    FCMPlugin.getToken(
        (t) => {
            console.log(t);
        },
        (e) => {
            console.log(e);
        }
    );

    FCMPlugin.onNotification(
        (data) => {
            console.log(data);
        },
        (e) => {
            console.log(e);
        }
    );

It works and I do receive a token. Though I can only receive notifications:

I cannot

Isn't my Ionic app subscribed automatically to my App Bundle Identifier, topics all and ios ?

wccrawford commented 6 years ago

Have you tried sending to /topics/all ? I did this with the API today and it works for my Android device.