Skip to content
This repository has been archived by the owner on Nov 24, 2019. It is now read-only.

Custom sound is not work on Android 6.0 or higher #80

Open
Kurom96 opened this issue Mar 10, 2017 · 0 comments
Open

Custom sound is not work on Android 6.0 or higher #80

Kurom96 opened this issue Mar 10, 2017 · 0 comments

Comments

@Kurom96
Copy link

Kurom96 commented Mar 10, 2017

Hello.

Notifications are playing with custom sound.
When Android version 6 or higher,
custom sound is not work ( notification sounds os default ).

  • Android 5.1.1 => Custom sound has sounded.
  • update Android version to 6.0.1 => Custom sound has sounded.
  • Delete application and install same application => OS default has sounded...

code bellow

// Add this so Titanium will add the permissions and links needed to play sounds
var sound = Titanium.Media.createSound();

var manager = require('bencoding.alarmmanager').createAlarmManager();
var current = new Date();

var options = {
	requestCode: 0,
	icon: Ti.App.Android.R.drawable.appicon,	
	year: current.getFullYear(),
	month: current.getMonth(),
	day: current.getDate(),
	hour: current.getHours(),
	minute: current.getMinutes() + 1,
	second: 0,
	contentTitle: 'notification',
	contentText: 'good morning',
	playSound: true,
	sound: Ti.Filesystem.getResRawDirectory() + 'notification1',
	vibrate: true,
	showLights: true,
	repeat: 'daily'
};

manager.addAlarmNotification(options);

notification1.mp3 placed in /platform/android/res/raw directory.

Do you know the solution?

environment

  • titanium sdk : 6.0.2.GA
  • AlarmManager : 0.17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant