Giter Club home page Giter Club logo

Comments (23)

macdonst avatar macdonst commented on July 20, 2024 1

@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.

quedicesebas avatar quedicesebas commented on July 20, 2024

Anyone had the opportunity to test it? It's a bug or it's possible I'm doing something wrong?

from phonegap-plugin-push.

macdonst avatar macdonst commented on July 20, 2024

@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.

macdonst avatar macdonst commented on July 20, 2024

@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.

quedicesebas avatar quedicesebas commented on July 20, 2024

I'm glad to know it, please let me know if you need anything, test on Andorid for example

from phonegap-plugin-push.

quedicesebas avatar quedicesebas commented on July 20, 2024

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.

macdonst avatar macdonst commented on July 20, 2024

@sebrojas14 sorry, did you pull from the issue17 branch?

from phonegap-plugin-push.

quedicesebas avatar quedicesebas commented on July 20, 2024

Nooo, my bad. This afternoon I'm gonna try again, I need it so bad. What about iOS?

from phonegap-plugin-push.

macdonst avatar macdonst commented on July 20, 2024

@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.

quedicesebas avatar quedicesebas commented on July 20, 2024

Ok, let me know

from phonegap-plugin-push.

quedicesebas avatar quedicesebas commented on July 20, 2024

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.

quedicesebas avatar quedicesebas commented on July 20, 2024

I'm gonna used in an app besides that. Please let me know when you know something about iOS

from phonegap-plugin-push.

macdonst avatar macdonst commented on July 20, 2024

@sebrojas14 I'm testing on a Nexus 5 and Nexus 6 running Android 5.1.1 and can't reproduce.

from phonegap-plugin-push.

quedicesebas avatar quedicesebas commented on July 20, 2024

What about iOS?

from phonegap-plugin-push.

macdonst avatar macdonst commented on July 20, 2024

@sebrojas14 swinging back around to iOS tomorrow :)

from phonegap-plugin-push.

macdonst avatar macdonst commented on July 20, 2024

@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.

macdonst avatar macdonst commented on July 20, 2024

Merged the fix

from phonegap-plugin-push.

alexislg2 avatar alexislg2 commented on July 20, 2024

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.

macdonst avatar macdonst commented on July 20, 2024

@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.

alexislg2 avatar alexislg2 commented on July 20, 2024

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.

dbadb avatar dbadb commented on July 20, 2024

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.

abdohossam5 avatar abdohossam5 commented on July 20, 2024

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.

lock avatar lock commented on July 20, 2024

This thread has been automatically locked.

from phonegap-plugin-push.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.