Meteor-Community-Packages / raix-push

DEPRECATED: Push notifications for cordova (ios, android) browser (Chrome, Safari, Firefox)
https://atmospherejs.com/raix/push
MIT License
514 stars 197 forks source link

Package broken in Meteor 1.5.1 #311

Closed derwaldgeist closed 6 years ago

derwaldgeist commented 6 years ago

Since I updated my app from Meteor 1.2 to 1.5.1, the push notifications package isn't working anymore. Safari is showing this error message on the console:

[Log] Error in Error callbackId: PushNotification599774518 : ReferenceError: Can't find variable: device (console-via-logger.js, line 173)
[Log] Uncaught Error: ReferenceError: Can't find variable: device:314:http://localhost:12328/cordova.js (console-via-logger.js, line 173)
[Error] ReferenceError: Can't find variable: device
    callbackFromNative (cordova.js:314)
    (anonyme Funktion) (ios-wkwebview-exec.js:132)
raix commented 6 years ago

Hi @derwaldgeist, I'll have to look into it - also have to upgrade the cordova plugin (guessing it's up for next release of the push package)

derwaldgeist commented 6 years ago

Hi @raix Thanks a lot for your fast response, highly appreciated - especially in these days where a lot of atmosphere packages are abandoned. Would be great if the plugin could be updated.

BTW: Someone in the forums mentioned that installing cocoapods is a new requirement in order to make push notifications work in Meteor:

https://forums.meteor.com/t/cordova-app-wont-compile-for-ios-after-upgrade-to-meteor-1-3-5-and-1-5/37924/2?u=waldgeist

Can you confirm this? It is also mentioned on the cordova plugin page. As it wasn't mentioned in the Meteor upgrade guide, I totally missed that information.

raix commented 6 years ago

hmm, yeah it's a build dependency for the cordova plugin - not 100% sure if we need to do an on installation check. I have also been thinking about publishing to npm instead - not sure what the best pattern would be though. (eg. having server/client code)

derwaldgeist commented 6 years ago

Don't think npm is capable of separating mobile and web code yet, a major drawback compared to Atmosphere packages. Since one would only need this package in the mobile app, there would be no way to exclude it from a web app. So I would still prefer this to be an Atmosphere package.

derwaldgeist commented 6 years ago

Did you already have time to look into this problem?

derwaldgeist commented 6 years ago

Here is some output from the Xcode console:

2017-07-25 16:12:31.436797+0200 guzz[7591:966695] Push Plugin register called
2017-07-25 16:12:31.443203+0200 guzz[7591:966695] Push Plugin register failed
2017-07-25 16:12:31.451394+0200 guzz[7591:966695] Push Plugin register failed
2017-07-25 16:12:31.471889+0200 guzz[7591:966748] - device [uniqueID:'com.apple.avfoundation.avcapturedevice.built-in_video:0', localizedName:'Back Camera', facing:back, audio:false, video:true, connected:true]
2017-07-25 16:12:31.472229+0200 guzz[7591:966748] - device [uniqueID:'com.apple.avfoundation.avcapturedevice.built-in_video:1', localizedName:'Front Camera', facing:front, audio:false, video:true, connected:true]
2017-07-25 16:12:31.472283+0200 guzz[7591:966748] - device [uniqueID:'com.apple.avfoundation.avcapturedevice.built-in_audio:0', localizedName:'iPad Mikrofon', facing:unknown, audio:true, video:false, connected:true]
2017-07-25 16:12:31.565995+0200 guzz[7591:966695] Error in Error callbackId: PushNotification1364571782 : ReferenceError: Can't find variable: device
2017-07-25 16:12:31.566627+0200 guzz[7591:966695] Uncaught Error: ReferenceError: Can't find variable: device:314:http://localhost:12328/cordova.js
2017-07-25 16:12:31.567897+0200 guzz[7591:966695] Error in Error callbackId: PushNotification1364571782 : ReferenceError: Can't find variable: device
2017-07-25 16:12:31.570031+0200 guzz[7591:966695] Uncaught Error: ReferenceError: Can't find variable: device:314:http://localhost:12328/cordova.js
2017-07-25 16:12:53.276889+0200 guzz[7591:966695] iosrtcPlugin#onReset() | doing nothing
2017-07-25 16:12:55.051598+0200 guzz[7591:966695] guzz: Running as mobile app (iOS)
2017-07-25 16:12:55.157524+0200 guzz[7591:966695] iosrtcPlugin#enumerateDevices()
2017-07-25 16:12:55.157641+0200 guzz[7591:966737] PluginEnumerateDevices#call()
2017-07-25 16:12:55.157819+0200 guzz[7591:966737] - device [uniqueID:'com.apple.avfoundation.avcapturedevice.built-in_video:0', localizedName:'Back Camera', facing:back, audio:false, video:true, connected:true]
2017-07-25 16:12:55.157889+0200 guzz[7591:966737] - device [uniqueID:'com.apple.avfoundation.avcapturedevice.built-in_video:1', localizedName:'Front Camera', facing:front, audio:false, video:true, connected:true]
2017-07-25 16:12:55.157926+0200 guzz[7591:966737] - device [uniqueID:'com.apple.avfoundation.avcapturedevice.built-in_audio:0', localizedName:'iPad Mikrofon', facing:unknown, audio:true, video:false, connected:true]
2017-07-25 16:12:55.167267+0200 guzz[7591:966695] Push Plugin register called
2017-07-25 16:12:55.169783+0200 guzz[7591:966695] Push Plugin register failed
2017-07-25 16:12:55.174636+0200 guzz[7591:966695] Push Plugin register failed
2017-07-25 16:12:55.188624+0200 guzz[7591:966695] Error in Error callbackId: PushNotification1676396299 : ReferenceError: Can't find variable: device
2017-07-25 16:12:55.188779+0200 guzz[7591:966695] Uncaught Error: ReferenceError: Can't find variable: device:314:http://localhost:12328/cordova.js
2017-07-25 16:12:55.188871+0200 guzz[7591:966695] Error in Error callbackId: PushNotification1676396299 : ReferenceError: Can't find variable: device
2017-07-25 16:12:55.188963+0200 guzz[7591:966695] Uncaught Error: ReferenceError: Can't find variable: device:314:http://localhost:12328/cordova.js

The video and audio device stuff is related to my WebRTC plugin. But the actual error messages seem to be related to push notifications.

derwaldgeist commented 6 years ago

I think I found the root cause. I didn't see that the 3.0.2 version now requires a pre-installed set of Cordova packages. My bad.

I still get an error message, though, that says (in German): Could not find a valid aps entitlement string for apps. Guess there's something missing in the configuration. Is there a kind of "upgrade guide" for 3.x? That would help me. :-)

derwaldgeist commented 6 years ago

Oooops. Forgot to enable Push notifications in Xcode. Seems to work now. Will now try to run it on a real server.