Due to some changes, the AndroidManifest.xml now requires android:exported="true" for nodes with intent-filters. As a result, building with meteor is not successful, as the above attributes are not set.
My current workaround for this is opening the prepared project in .meteor/local/... in Android Studio and edit the Manifest xml file there.
Then a second issue occurs, which is related to the new requirement that for some PendingIntend method calls a FLAG_IMMUTABLE or FLAG_MUTABLE must be set. (App crashes as soon as a notifcation in received by the device.) This comes from a file FCMService.java in the phonegap-plugin-push. Also this can be solved by adding the FLAG_IMMUTABLE bitmask.
I’d now like to automate the bulding process. Tried already to use edit-config options from Cordova in mobile-settings.js, but with no success (got some double entries and, hence, new errors during build). The second issue could be maybe resolved by forking that plugin and incorporating a fork into The trusted source for JavaScript packages, Meteor resources and tools | Atmosphere
a new version of Push is due but I am not yet ready to release it. As you probably noticed, phonegap-plugin-push has been deprecated for a while and the new version of Push will be based on @havesource/cordova-plugin-push. I am just waiting for a release of Meteor 2.8 and understand the changes I need to make to accommodate it.
The same problem you have has been fixed in the @havesource/cordova-plugin-push plugin but a new version has not yet been released. If you want, I can share with you the new package and you can then try and build your project based on the indications from the new cordova plugin repo.
I’d need some time even to do that. A lot of things changed in the Meteor side as well. I opened the project towards having server roles, you can set up a Meteor server to only be sender of Push while the others send jobs in the queue. I am planning to add an email queue as well and enable methods for Email as well as Push since many developers think of these together. So, I don’t thing any version/branch will be published soon.
Hey @paulishca - any news on an update for Push?
We’ve been running into Android build issues with our existing project when attempting to target SDK31 due to the exported error - it seems like Meteor 2.8 requires Java11 to build properly, but your comments here make me think that we need to downgrade meteor below 2.8 until you put out an update (and stop using java11). Do you think this is the case?
Oh my word - I have been battling this for 4 days now. I use @havesource version and it took me ages to get that to install and build, BUT and think this is the crux of the problem, Cordova Android 10.x doesn’t support API 31 (Android Platform Guide - Apache Cordova) so whatever you do, it will never work. I think I have trashed my setup because I have tried every combo of JAVA 8 (which is really v1.8) and JAVA 11 but the latter fails very early on, and the former won’t build. Personally I find the whole Java/Gradle a mess and a mystery. It seems so opaque I struggled to get to the bottom of the problem, but I am in the same situation as the OP. I want to push a new version of the app to the app store, but google won’t allow it.
I think we need to ask for Cordova 11 for Android to be included in a patch release (2.8.2?)
The issue you are facing seems to be plugin specific, so you will either need to fork the plugin and fix the compatibility issues or maybe go another way for push notifications (like OneSignal, for example).
Hello, about using the fixed version of the @havesource/cordova-plugin-push plugin, it is just needed to install the plugin from the github’s repo commit with the fix:
// mobile-config.js
App.configurePlugin('@havesource/cordova-plugin-push', {
// FCM_VERSION: '21.1.+', // off for version 3.0.1 of cordova plugin.
SENDER_ID: '552803819837',
IOS_FIREBASE_MESSAGING_VERSION: '9.1.0' // makes use of the new replacement of instance id for IOS. Adjust version of the plugin to pull from GIT
})
You would need to switch commented lines for whether you build Android (as it is se now) or you build IOS.