ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
12.04k stars 999 forks source link

bug: ios local notifications no sound #7193

Closed noevermaurice closed 8 months ago

noevermaurice commented 8 months ago

Bug Report

Capacitor Version

 @capacitor/cli: 5.6.0
  @capacitor/core: 5.6.0
  @capacitor/android: 5.6.0
  @capacitor/ios: 5.6.0

Installed Dependencies:

  @capacitor/cli: 5.6.0
  @capacitor/core: 5.6.0
  @capacitor/android: 5.6.0
  @capacitor/ios: 5.6.0

[success] iOS looking great! 👌
[success] Android looking great! 👌

Platform(s)

List the platforms that this bug affects.

ios

Current Behavior

i schedule a local notification for ios and android, on android i have sound but on ios i have NO SOUND

Expected Behavior

i expect that ios get a sound , the default sound for a local notification

Code Reproduction

Next js code with capsitor local notification plugin


   let scheduleOptions: { every: string; allowWhileIdle: boolean; };
await LocalNotifications.schedule({
            notifications: [
                {
                    title: title,
                    body: body,
                    id: notificationID,
                    ongoing: true,
                    schedule: scheduleOptions
                }
            ],
        });

capasitor config.ts

import { CapacitorConfig } from '@capacitor/cli';
import { KeyboardResize, KeyboardStyle } from '@capacitor/keyboard';

const config: CapacitorConfig = {
  appId: 'com.mn.checknnotespro',
  appName: 'CheckNotesPro',
  webDir: 'out',
  plugins: {
    Keyboard: {
      resize: KeyboardResize.Body,
      style: KeyboardStyle.Dark,
      resizeOnFullScreen: true,
    },
"LocalNotifications": {
"backgroundPermission": "granted",
smallIcon: "ic_stat_icon_config_sample",
iconColor: "#488AFF",
sound: "test.wav"

}

  }
};

export default config;

Other Technical Details

i use next js 13.5.6 and static export with capasitor to build apps for andriod and ios which use local notifications

npm --version output: 10.1.0

node --version output:v20.9.0

pod --version output (iOS issues only):1.14.3

Additional Context

HOW i can fixed that to get the a notificationSOUND on IOS?

jcesarmobile commented 8 months ago

The sound on the configuration is for Android only because it uses channels. For iOS you have to configure the sound on the own notification. https://capacitorjs.com/docs/apis/local-notifications#localnotificationschema

noevermaurice commented 8 months ago

Can you please give my a code example how i can use local notifications in ios with default sound ?!

ionitron-bot[bot] commented 7 months ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.