Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this.once('ready') function is undefined in Cordova.js - activitree:push v2.0.8 #35

Open
mikamarkus opened this issue Apr 13, 2021 · 1 comment

Comments

@mikamarkus
Copy link

I'm trying to trigger routing action via following function:

CordovaPush.push.on('notification', data => { // Route somewhere according to parameter })

When I'm clicking the notification, my listener function does not get triggered, because Cordova.js dies after trying to set badge on line 29. I think it's because 'once' function does not exists anymore after removing deprecated raix -packages in last version.

Console error:


Error in Success callbackId: PushNotification270011709 : TypeError: undefined is not a function (near '...this.once...')
cordova.js:1540

setBadge@http://localhost:12688/__cordova/packages/activitree_push.js?hash=7a9a9ac94bc9741966430eda9a0a4236da660e6d:111:16
http://localhost:12688/__cordova/packages/activitree_push.js?hash=7a9a9ac94bc9741966430eda9a0a4236da660e6d:221:32
emit@http://localhost:12688/plugins/phonegap-plugin-push/www/push.js:295:25
success@http://localhost:12688/plugins/phonegap-plugin-push/www/push.js:56:19
callbackFromNative@http://localhost:12688/cordova.js:295:63
http://localhost:12688/plugins/cordova-plugin-wkwebview-engine/src/www/ios/ios-wkwebview-exec.js:129:35
http://localhost:12688/__cordova/packages/meteor.js?hash=65c4a13f0259405d858d17417f5e24851f0421c0:1266:27
promiseReactionJob@[native code]
raise — promise.js:763

Any suggestions?

activitree:push version. 2.0.8

@paulincai
Copy link
Contributor

Hi,
I am not sure what the problem might be here, I don't have any issues in this area.
Would you please try to route vie the action with the method. E.g

Meteor.call('userPushNotification', {
        title: 'Notification title',
        body: 'Notification Body',
        badge: 1,
        userIds: ['xxxxx', 'xxxxxxxxxx'],
        action: '/your_url'
      })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants