{"_id":"@elgibor-solution/fcm-custom-sound","name":"@elgibor-solution/fcm-custom-sound","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@elgibor-solution/fcm-custom-sound","version":"1.0.0","description":"Custom notification sound of FCM","main":"index","typings":"index.d.ts","nativescript":{"platforms":{"ios":"6.0.0","android":"6.0.0"}},"repository":{"type":"git","url":"git+https://github.com/elgiborsolution/esolution-nativescript-plugins.git"},"keywords":["NativeScript","JavaScript","TypeScript","iOS","Android"],"author":{"name":"Febri Arief","email":"febriarief6661@gmail.com"},"bugs":{"url":"https://github.com/elgiborsolution/esolution-nativescript-plugins/issues"},"license":"Apache-2.0","homepage":"https://github.com/elgiborsolution/esolution-nativescript-plugins","bootstrapper":"@nativescript/plugin-seed","types":"./index.d.d.ts","gitHead":"40c5ddfa656595d44e7a3c64e20e5936531873fd","_id":"@elgibor-solution/fcm-custom-sound@1.0.0","_nodeVersion":"18.10.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-NIDdVULNHfatunvhymlAZ80/bebTlbR5MQOIrI2NrQY4jK4TJ5sOokRmdi/9o5zsGuBdrjQvRw+CBMsM3NVdrw==","shasum":"480d544a4cf866b1b210353b0c7eb1390006c818","tarball":"https://registry.npmjs.org/@elgibor-solution/fcm-custom-sound/-/fcm-custom-sound-1.0.0.tgz","fileCount":13,"unpackedSize":18022,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcgiKhU4K52b0YoGcq1G4cZBngIJJJ4vUdwsEPUlKlRwIhALaVrUDf/WV0F0wnk2zRvNsxvp4j5srp1AbZ4rYt2itm"}]},"_npmUser":{"name":"febriarief","email":"febriarief6661@gmail.com"},"directories":{},"maintainers":[{"name":"febriarief","email":"febriarief6661@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fcm-custom-sound_1.0.0_1701898374522_0.4447303072845743"},"_hasShrinkwrap":false}},"time":{"created":"2023-12-06T21:32:54.444Z","1.0.0":"2023-12-06T21:32:54.722Z","modified":"2023-12-06T21:32:55.043Z"},"maintainers":[{"name":"febriarief","email":"febriarief6661@gmail.com"}],"description":"Custom notification sound of FCM","homepage":"https://github.com/elgiborsolution/esolution-nativescript-plugins","keywords":["NativeScript","JavaScript","TypeScript","iOS","Android"],"repository":{"type":"git","url":"git+https://github.com/elgiborsolution/esolution-nativescript-plugins.git"},"author":{"name":"Febri Arief","email":"febriarief6661@gmail.com"},"bugs":{"url":"https://github.com/elgiborsolution/esolution-nativescript-plugins/issues"},"license":"Apache-2.0","readme":"# Nativescript FCM Custom Sound Notification\nCustom notification sound of firebase cloud messaging (FCM). <b>Currently only working on Android</b>.\n\n## Installation\n```javascript\nns plugin add @elgibor-solution/fcm-custom-sound\n```\n\n## Usage\n```typescript\n# app.component.ts\n\nimport { customSound, CustomSoundOptions } from '@elgibor-solution/fcm-custom-sound';\n\nconst options: CustomSoundOptions = [\n    { channelId: 'channel_1', audio: 'notif' },\n    { channelId: 'channel_2', audio: 'notif2' }\n];\n\ncustomSound(options);\n```\n\n## API\n| Methods                   | Return Type | Description |\n| ------------------------- | --------    | ----------- |\n| `customSound(options: CustomSoundOptions[])` | `void` | Plays custom sounds based on the provided configuration options. |\n\n### CustomSoundOptions Interface\n| Name                   | Type | Description |\n| ---------------------- | --------    | ----------- |\n| `channelId`            | `string` | The channel identifier for the custom sound.|\n| `audio`                | `string` | The audio file path or resource identifier for the custom sound. Currently only support `.wav` audio file. Audio file should be placed to folder: `App_Resources/Android/src/main/assets/raw`|\n\n## ⚠️ Important!\nTo enable notification sounds to play in the background, the <b>backend</b> sending FCM <b>must set the channel name or id</b> according to the one specified by the Android application. <p>\nThe audio file must be in `.wav` format and placed in the `App_Resources/Android/src/main/assets/raw` folder.\nThe `audio` property in the `CustomSoundOptions` interface should only contain the file name without the extension. For example, if the audio file is named `notif.wav`, only `notif` is required.\n\n## Authors\n- [@febriarief](https://www.github.com/febriarief)\n\n## License\nApache License Version 2.0","readmeFilename":"README.md"}