Someone use https://atmospherejs.com/activitree/push ?
I have problems with receiving messages on some android devices and the notification sound does not work, does anyone have experiences about it ?
Hi, I use it and also take care of it.
Are you using and sending a custom sound via the configuration? This package will not dictate whether the sound should play or not but rather if the sound is a custom or the default on device. You can check the official API here and see if you feel something is missing from the Meteor packages: https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#androidconfig. It works ok for me even with a custom sound.
By âsome Android devicesâ do you mean some brands or some random devices of eventually the same brand/model? Do you see those devicesâ tokens in your DB? Do you see any errors in your Google API console? Perhaps if you activate debugging in the package, you could read sending errors on the server console.
I am not sure how I can help, your request for help is a little vague.
Hi and thanks for the answer, who could give it to me better if not who made the plugin?!
I think I followed all the official plugin directions here GitHub - activitree/meteor-push: Meteor Push Notifications for Cordova and Web/PWA with Firebase (FCM).
I have installed GitHub - phonegap/phonegap-plugin-push: Register and receive push notifications 2.3.0.
I configured my application as in the example
meteor-push/example/app at master ¡ activitree/meteor-push ¡ GitHub
My âpush_methods.jsâ is identical and is in / lib
In server and client startups I put:
- meteor-push/index.js at master ¡ activitree/meteor-push ¡ GitHub
-
meteor-push/index.js at master ¡ activitree/meteor-push ¡ GitHub
My push to call is:
const res = Push.send ({
from: âmyAppâ,
title: âtest notificationâ,
body: âtest bodyâ,
badge: 1,
userId: [userId],
});
With active debugging I see in my console that everything is fine, the notification is sent and received by the Android device, you can hear the vibration but not the sound, I have done many tests but there is no way to make it sound.
the configuration files of github, the ones that I poked above, are fine, right ?
I would just like to get the default sound, I donât have to customize it.
Can you give me some advice ?
excuse me @paulishca,
can you show me what value you set for âsoundâ key, in the various file ?
I have tray more and more, but donât works in any wayâŚ
Hi @davideonmeteor I use the startup/server configuration as described in the repo/ example. I do use custom sounds. Those files in the example are exactly what I use in my projects. I suggest you check on the cordova-push-plugin side if there are people experiencing the same problem. You could also open a ticket for this matter and mention your exact versions not working and maybe somebody had the same experience. Initially you mentioned that some phones donât get the messages or so. Is that still an issue for you? :
sound: 'note', // String (file has to exist in app/src/res/... or default on the mobile will be used). For Android no extension, for IOS add '.caf'
thanx @paulishca,
I have do it but no luckyâŚ
I have also tried to set a console.log and error in â/lib/push_methods.jsâ, in:
run (notification) {
// Add your Method Level security preference here.
// if (!this.userId) {
// throw new Meteor.Error(404, 'No userId was set, userId was ' + userId)
// }
console.log(âHEREâ);
throw new Meteor.Error(404, âerror testâ)
// topic in IOS and Android have different behaviors. In IOS it must be set as the app id,
// in Android a notification can be sent to a topic (to its subscribers)
// Doing some cleanup on useless keys of the notification object, if any.
Object.keys(notification).map(key => (notification[key] === null || notification[key] === undefined) && delete notification[key])
The strange is that console.log is not display in my console, and no error⌠should appear, right ?!
If you can give me another indication:
For the sound, I extract myApp.apk, there isnât a path like âapp/src/resâ, what is the right path where the audio file must be ? I use a audio file named âalya.oggâ.
I have done a little step forwardâŚ
I discovered that in notification option in the app, there is a PhoneGap PushPlugin and the audio was set to âaudio supplied by the appâ, if I change this setting and I choose a sound tone, the notification now will sound !
Now, I want to set a custom sound, because I donât want users to have to set this manually.
In meteor you can set resource in mobile-config.js by "App.addResourceFile(âsound1.mp3â, âres/raw/sound1.mp3â, âandroidâ) but it doesnât work.
adb logcat shows me this message âFileSource: Failed to open file âandroid.resource://app.myapp/raw/trueâ. (No such file or directory)â.
Isnât it weird ? Why the path is âapp.myapp/raw/trueâ, I was expecting âapp.myapp/raw/sound1.mp3â.
How did you set âApp.addResourceFile(âsound1.mp3â, âres/raw/sound1.mp3â, âandroidâ)â exactly ? (obviously using ânoteâ instead of âsound1â).
Maybe is this issue ?
I think I understand the problem, it is a bug of the Cordova component https://github.com/phonegap/phonegap-plugin-push which misprints the path of the sound file (thatâs why in the logcat appears "FileSource: Failed to open file âandroid.resource: //app.myapp/raw/trueâ. (No such file or directory) ".
I then simply removed the âsoundâ key in âhttps://github.com/activitree/meteor-push/blob/master/example/app/startup/client/index.jsâ and now the notification plays the default sound , if you want to customize the sound you have to do it from the settings of the Cordova plugin in the device itself.
Another consideration is that this behavior I have on Android 9, on Android 7 instead it works well and on Android 8 I was unable to try it.
@paulishca, I donât know why it worked the same for you, maybe your app is only used on Android 7, or you have an old version of the Cordova plugin.
Sorry @paulishca , can you give me a feedback about it ?
It would be very important for me to understand thisâŚ
Thank you.
Hi @davideonmeteor I am not an expert in Android. This package leverages on existing Cordova plugins which are not in my control. Simply put, any Cordova plugin has hooks in both directions. In my case Meteor <â>Cordova Plugin <â>Android. I only control Meteor + the hooks into the Cordova plugin. The plugin itself and what is left of the entire âecosystemâ are not in the scope of this package. However, if you find a feature in Firebase Admin (FMC) or Cordova plugin that is not implemented, you can open a PR in the package itself and have it implemented or open a ticket and wait for somebody to do it.
I hope this helps.
thank you so much for your answer itâs really help full i am also facing same issue but now my issue resolved thank for helping
Hi, for general info: With the same push plugin, I also had to change the sound: setting in the client-init from true
to default
to get the default sound to play.
are you sure ?
In my project I had disable this parameter due to No default notification sound from default PushPluginChannel in Android 8+ ¡ Issue #2584 ¡ phonegap/phonegap-plugin-push ¡ GitHub , is a open bug.
Hi, yes.
Weâre using phonegap-plugin-push@2.3.0 and it seems to be working.
I also send this with the payload:
sound: isSilentPush ? '' : 'default',
And I get the sound now.
Iâve explained here on last Friday how I send push notifications in my apps
Building Native Apps in Hours with Meteor | Dourados, Brazil Meetup (English)
yes, but in your presentation you using onesignal for push notifications service, not firebase, so activitree-push plugin doesnt works.
@filipenevola do you think is a good choice not using Firebase service (Google services) ? What about using resource for a new service, for battery, networkâŚ
Hi, why activitree-push doesnât work? Could you submit a fix for what you found not working, please.
I mean with onesignal.com donât works, with firebase (Google service) ther isânt problem, works good.
Or Iâm wrong ? @paulishca activitree-push can use with onesignal.com ?