Notifications not showing on IOS with cordova plugin @havesource/cordova-plugin-push

[ad_1]

I need help with firebase notifications not working on my Ipad with PWA
cordova version: 11.
I’m using @havesource/cordova-plugin-push plugin.

this is my sent message.

{
    "to" : "/topics/user_topic",
    "notification": {
        "title" : "this is test title 4 IOS",
        "body": "this is test body"
    },
    "content_available": true
}

this is my plugin init code in PWA:

initPush() {
    console.log('Initializing push plugin.');
    let config = {
      android: {
        vibrate: true,
        clearNotifications: true
      },
      ios: {
        fcmSandbox: true,
        alert: true,
        badge: true,
        sound: true
      }
    }

    let push  = PushNotification.init(config);
    PushNotification.hasPermission(
      () => {
      console.log("Notification permission granted");
        push.subscribe("user_topic", () => {
          console.log("Subscribed to user_topic");},
          () => {
          console.log("cannot subscribe");
          });
        push.on(
        'notification',
        (data: any) => {
          console.log(data);
        });
        push.on(
          'error',
          (data: any) => {
            console.log(data);
          });
      },
      () => {
        console.log("not permitted to receive notifications!");
      }
    );
  }

And this is what I get in log

2022-04-07 10:39:58.394281+0200 MobileApp[15262:495753] PushPlugin skip clear badge
2022-04-07 10:39:58.869358+0200 MobileApp[15262:495753] The preference key "AutoHideSplashScreen" is not defined and will default to "TRUE"
2022-04-07 10:39:59.045482+0200 MobileApp[15262:495753] Initializing push plugin.
2022-04-07 10:39:59.095513+0200 MobileApp[15262:495753] Notification permission granted
2022-04-07 10:39:59.095776+0200 MobileApp[15262:495753] subscribe from topic: user_topic
2022-04-07 10:39:59.110737+0200 MobileApp[15262:495753] Successfully subscribe to topic user_topic
2022-04-07 10:39:59.110975+0200 MobileApp[15262:495753] THREAD WARNING: ['PushNotification'] took '15.206055' ms. Plugin should use a background thread.
2022-04-07 10:39:59.121693+0200 MobileApp[15262:495753] Push Plugin VoIP missing or false
2022-04-07 10:39:59.121896+0200 MobileApp[15262:496009] Push Plugin register called
2022-04-07 10:39:59.121960+0200 MobileApp[15262:496009] PushPlugin.register: setting badge to false
2022-04-07 10:39:59.122359+0200 MobileApp[15262:496009] PushPlugin.register: clear badge is set to 0
2022-04-07 10:39:59.122415+0200 MobileApp[15262:496009] PushPlugin.register: better button setup
2022-04-07 10:39:59.136426+0200 MobileApp[15262:496009] FCM Sender ID 1079642262479
2022-04-07 10:39:59.136848+0200 MobileApp[15262:495753] Subscribed to user_topic
2022-04-07 10:39:59.139873+0200 MobileApp[15262:496009] Using FCM Notification
2022-04-07 10:39:59.143171+0200 MobileApp[15262:496009] Using FCM Sandbox
2022-04-07 10:39:59.147152+0200 MobileApp[15262:496011] 6.32.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: some url.
2022-04-07 10:39:59.180689+0200 MobileApp[15262:496011] 6.32.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: some url.
2022-04-07 10:39:59.399222+0200 MobileApp[15262:496017] 6.32.0 - [Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO. Follow the instructions at: some google url #method_swizzling_in_firebase_messaging to ensure proper integration.
2022-04-07 10:39:59.465435+0200 MobileApp[15262:495753] Remote instance ID (FCM Registration) Token: dEEoc-ZTw0uPn8W0gWYIIk:APA91bFoLoSDlEhQjtdTnkri7ObWQtpxKvrRQhb88OY_t5uJOCawpyD2zl59GbsMqEVj8W0iJgkIsZN_ZywTUkOfHiN1mLyxTInYkxkcjdBI2H4KCTugkFUWRVTjKP3P4OPELLqWHu3Y
2022-04-07 10:39:59.465736+0200 MobileApp[15262:495753] The FCM registration token needs to be changed.
2022-04-07 10:39:59.467143+0200 MobileApp[15262:495753] Remote instance ID (FCM Registration) Token: dEEoc-ZTw0uPn8W0gWYIIk:APA91bFoLoSDlEhQjtdTnkri7ObWQtpxKvrRQhb88OY_t5uJOCawpyD2zl59GbsMqEVj8W0iJgkIsZN_ZywTUkOfHiN1mLyxTInYkxkcjdBI2H4KCTugkFUWRVTjKP3P4OPELLqWHu3Y
2022-04-07 10:40:00.460113+0200 MobileApp[15262:495753] The FCM registration token needs to be changed.
2022-04-07 10:40:00.461093+0200 MobileApp[15262:495753] Remote instance ID (FCM Registration) Token: fWmg0xS3I0xslBHpaLBOvM:APA91bGKYgfF8Lc6liN_-t3iTgIHnM9WuEnQLjh65_zFQcwfSvTwh8pTSb6honrpCM78B10oy4-qqNMTV9EZVqdvV_J7jyWi_CzhEKz15-9qk5yMJE4DOvHKG6vlFPqjtgkhvF-b3nv_
2022-04-07 10:40:04.686428+0200 MobileApp[15262:495753] Push Plugin register success: {length = 32, bytes = 0xc79fbd12 1e49eac0 ffb03532 1e77f52f ... 9ee9d858 daa00a98 }
2022-04-07 10:40:04.992756+0200 MobileApp[15262:495753] active
2022-04-07 10:40:04.993124+0200 MobileApp[15262:495753] PushPlugin skip clear badge
2022-04-07 10:40:05.008727+0200 MobileApp[15262:495753] Push Plugin register success: {length = 32, bytes = 0xc79fbd12 1e49eac0 ffb03532 1e77f52f ... 9ee9d858 daa00a98 }

Log says that sender ID is set, meaning the plugin is connected to firebase cloud messaging and log also says that app is subscribed to user_topic topic on firebase cloud messaging.

I can’t see anything wrong in log, so I’m not sure where to look next of why I’m not receiving any pushed notifications.

Notifications work on Android device.

Any help with ideas appreciated.

I’ve even created github project with all the code

[ad_2]

Source link

Leave a Reply

Your email address will not be published.