Uploaded image for project: 'Appcelerator Modules'
  1. Appcelerator Modules
  2. MOD-2429

Arrow Push Custom Notification Sounds for Android 8+ Not Found

    Details

    • Type: Bug
    • Status: In Review
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: CloudPush
    • Labels:
    • Environment:

      Android SDK 26 and above.

      Description

      Titanium 7.1.1.GA

      When sending Arrow Push notifications with a custom sound file to an Android device running Android 8 or above, the sound is not found and depending on the status of the app (foreground or background, the app either only plays the device default sound, or crashes the app.

      A sample payload:

      {
        "alert": "My Alert Text",
        "icon": "q",
        "badge": " 1",
        "sound": "popq.wav",
        "vibrate": "false",
        "title": "My Title",
        "priority": "high",
        "content-available": 0
      }
      

      The sounds are located at:
      /resources/popq.wav (For iOS)
      /resources/sound/popq.wav (for Android)

      Note: The docs state to specify the sound without the extension. However, I am only able to get the push notification custom sounds to work on both Android and iOS WITH the extension specified. If you do not specify an extension, then you get the default notification sound on both Android and iOS. I am using WAV because that sound format is supported by both Android and iOS. Icon works fine with not including the extension.

      With app in foreground:

      [WARN] :   W/System.err: java.io.FileNotFoundException: /sdcard/cocoafish/sound/com.walkthelot.qalerts/popq.wav (No such file or directory)
      [WARN] :   W/System.err: 	at java.io.FileOutputStream.open0(Native Method)
      [WARN] :   W/System.err: 	at java.io.FileOutputStream.open(FileOutputStream.java:287)
      [WARN] :   W/System.err: 	at java.io.FileOutputStream.<init>(FileOutputStream.java:223)
      [WARN] :   W/System.err: 	at java.io.FileOutputStream.<init>(FileOutputStream.java:110)
      [WARN] :   W/System.err: 	at com.appcelerator.aps.APSCloudPush.getAndTransferFile(APSCloudPush.java:544)
      [WARN] :   W/System.err: 	at com.appcelerator.aps.APSCloudPush.showTrayNotification(APSCloudPush.java:443)
      [WARN] :   W/System.err: 	at com.appcelerator.aps.APSCloudPush.receivePayload(APSCloudPush.java:269)
      [WARN] :   W/System.err: 	at com.appcelerator.aps.GCMReceiver.onReceive(GCMReceiver.java:30)
      [WARN] :   W/System.err: 	at android.app.ActivityThread.handleReceiver(ActivityThread.java:3187)
      [WARN] :   W/System.err: 	at android.app.ActivityThread.-wrap17(Unknown Source:0)
      [WARN] :   W/System.err: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1672)
      [WARN] :   W/System.err: 	at android.os.Handler.dispatchMessage(Handler.java:106)
      [WARN] :   W/System.err: 	at android.os.Looper.loop(Looper.java:164)
      [WARN] :   W/System.err: 	at android.app.ActivityThread.main(ActivityThread.java:6494)
      [WARN] :   W/System.err: 	at java.lang.reflect.Method.invoke(Native Method)
      [WARN] :   W/System.err: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
      [WARN] :   W/System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
      [WARN] :   Notification: Use of stream types is deprecated for operations other than volume control
      [WARN] :   Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
      

      When app is closed I get an Android error that APP Name has stopped, and no notification comes through.

      This all works flawlessly on iOS and any Android device running Android API 25 or LOWER. The app is in production on both iOS and Android stores. For Android installations greater than API 25 I just disable the option for the user to choose a custom sound.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ybanev Yordan Banev
                Reporter:
                ken@walkthelot.com Ken Rucker
                Reviewer:
                Gary Mathews
              • Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Git Source Code