问:
setNotificationSound方法设置提示音,无法生效,代码如下:
PushManager.startWork(getApplicationContext(),
PushConstants.LOGIN_TYPE_API_KEY, api_key);
CustomPushNotificationBuilder cBuilder = new CustomPushNotificationBuilder(
resource.getIdentifier("notification_custom_builder", "layout",
pkgName), resource.getIdentifier("notification_icon",
"id", pkgName), resource.getIdentifier(
"notification_title", "id", pkgName),
resource.getIdentifier("notification_text", "id", pkgName));
cBuilder.setNotificationFlags(Notification.FLAG_AUTO_CANCEL);
cBuilder.setNotificationDefaults(Notification.DEFAULT_VIBRATE);
cBuilder.setStatusbarIcon(this.getApplicationInfo().icon);
cBuilder.setLayoutDrawable(resource.getIdentifier(
"simple_notification_icon", "drawable", pkgName));
cBuilder.setNotificationSound("android.resource://" + getPackageName()
+ "/" + R.raw.notifysnd);
// 推送高级设置,通知栏样式设置为下面的ID
PushManager.setNotificationBuilder(this, 1, cBuilder);