Comments (23)
@sebrojas14 if you pull the latest from this github repo then you can test. You have to put the sound file in the platforms/android/res/raw
directory and when you send the push just use it's name, omit the extension.
from phonegap-plugin-push.
Anyone had the opportunity to test it? It's a bug or it's possible I'm doing something wrong?
from phonegap-plugin-push.
@sebrojas14 root cause of the issue is sounds in the assets folder are private to the app and not accessible from the notification service.
from phonegap-plugin-push.
@sebrojas14 So, I've been working on this a bit tonight. The sound file will need to get copied from the asset/www folder to the res/raw folder on Android in order to work. I will look at creating a hook for this soon and test on iOS as well.
from phonegap-plugin-push.
I'm glad to know it, please let me know if you need anything, test on Andorid for example
from phonegap-plugin-push.
I tried it but doesn't work. I put the beep.wav file in platforms/android/res/raw, and if I look into the apk file is in it. In the payload I sent 'soundname': 'beep'. Missing something?
from phonegap-plugin-push.
@sebrojas14 sorry, did you pull from the issue17 branch?
from phonegap-plugin-push.
Nooo, my bad. This afternoon I'm gonna try again, I need it so bad. What about iOS?
from phonegap-plugin-push.
@sebrojas14 No, my bad. I forgot to mention the branch. I took a look at iOS and it should work but I need to double check where the sound should be packaged on iOS.
from phonegap-plugin-push.
Ok, let me know
from phonegap-plugin-push.
It works on Android (OnePLus One, OxygenOS, Android 5.0.2, using a .wav audio and a .mp3)!! But the sound starts and starts again like half a second later (so is cropped and then it plays all). And in foreground is worst, starts over and over again
from phonegap-plugin-push.
I'm gonna used in an app besides that. Please let me know when you know something about iOS
from phonegap-plugin-push.
@sebrojas14 I'm testing on a Nexus 5 and Nexus 6 running Android 5.1.1 and can't reproduce.
from phonegap-plugin-push.
What about iOS?
from phonegap-plugin-push.
@sebrojas14 swinging back around to iOS tomorrow :)
from phonegap-plugin-push.
@sebrojas14 I got a chance to test this and it works. If I do the following to generate a proper sound:
afconvert /System/Library/Sounds/Submarine.aiff ~/Desktop/sub.caf -d ima4 -f caff -v
and put the resulting sub.caf
in the root of my Xcode project then send the following push:
{
"aps": {
"alert": "test sub",
"sound": "sub.caf"
}
}
I hear the correct sound.
See this link for more info: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW6
from phonegap-plugin-push.
Merged the fix
from phonegap-plugin-push.
What do you mean "put the resulting sub.caf in the root of my Xcode project". In the directory /platforms/ios/ ? or /platforms/ios/project_name/ ? Or inside the xcode project tree?
Documentation is not so clear about it, neither about if we have to pass sound.mp3
or sound
as a payload. I'll make a PR for the doc if I got a chance to make it work!
from phonegap-plugin-push.
@alexislg2 It would be /platforms/ios
. If you see the above comment you are supposed to supply an extension. Also, .mp3 may not work. Check the https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW6 link for information on what file types iOS supports.
from phonegap-plugin-push.
Thanks. In fact what I didn't get was that I have to drag and drop the file
inside the Xcode project
It's working now
On Thu, Sep 10, 2015 at 5:16 PM, Simon MacDonald [email protected]
wrote:
@alexislg2 https://github.com/alexislg2 It would be /platforms/ios. If
you see the above comment you are supposed to supply an extension. Also,
.mp3 may not work. Check the
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW6
link for information on what file types iOS supports.—
Reply to this email directly or view it on GitHub
#17 (comment)
.
from phonegap-plugin-push.
Here we are in Sep 2016 and this issue raises its ugly head again :-)
I have working files residing here: "www/snd/beep.caf". I'm referencing these files from the APN server with the same relative path in the notification payload. These work on IOS 9 but not on IOS 10.0.1 (from the same build!). Either its a new behavior triggered by compat layers in IOS 10 or its a bug in IOS 10. Here's a thread: http://stackoverflow.com/questions/39400703/ios10-custom-push-notification-sound-not-playing. My impression is that it's not as straightforward as the answer suggests. That is, the claim there is that it's an xcode 8 bug.
I'm not confident that the relative path references should be expected to work or fail (though they work on iOS 9) and welcome any thoughts/comments on this matter.,
from phonegap-plugin-push.
same issue here with ios 10
Using version 1.8.2 of the plugin and testing on iphone 6s. sound was working fine on ios 9 and even on ios 10 when running the app using cordova run ios. The issue only occurs when running with xcode not sure about the store version yet.
from phonegap-plugin-push.
This thread has been automatically locked.
from phonegap-plugin-push.
Related Issues (20)
- Callbacks (hasPermission, register) are not called on iOs 13 HOT 3
- @parmarkaushik15 yeah, like I said in my last comment, if the app is forced closed there is no web view in memory to run the JS. The best you can do at this point is look into using the force start parameter. HOT 1
- ios: notification event not firing after app is closed when user opens app directly - works on android HOT 1
- On notification event not firing when cordova local notification plugin is installed. HOT 5
- IOS. Does not show 'Allow / Deny' notification dialog and not receiving push notification
- Blank screen is displayed in few devices instead of picture
- iOS13 APNS Device Token HOT 2
- getNotificationSettingsWithCompletionHandler - completion handler never executes on iOS 9.3.5
- Incompatibilty phonegap-plugin-push whit cordova-plugin-googlemaps HOT 5
- Unable to send push to browser(Firefox, Chrome) using fcm/gcm getting 'InvalidRegistration'
- On Android it receives notifications but they don't appear on Firebase Analytics
- Not every key in the firebase's {android/ios}.notification object is supported in "additionalData" object
- Unable to compile 2.3.0
- HELP - Failed to install 'phonegap-plugin-push': undefined - cocoapods -macOs Catalina HOT 1
- registration is not called
- iOS: Can't process background notification on low battery
- Security Error with android:exported=true
- [Android] on('notification') 'coldstart' value is acting wacky and not as documented (works only on iOS)
- Sporadic registrations on iOS using Xcode
- FCM version is not up-to-date.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phonegap-plugin-push.