JPush无法关闭声音和震动

conghuahuadan
2019-06-14 01:44 458 0

官方工程MainActivity加入如下代码

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    initView();
    registerMessageReceiver();  // used for receive msg

    BasicPushNotificationBuilder builder = new BasicPushNotificationBuilder(this);
    builder.notificationDefaults = Notification.DEFAULT_LIGHTS;
    JPushInterface.setPushNotificationBuilder(1, builder);
}

Gradle编译版本修改如下

android {
    compileSdkVersion 28 // 默认是25

    ...

    defaultConfig {
        targetSdkVersion 28 // 默认是21
        minSdkVersion 9
    }
}

无法关闭声音和震动。
compileSdkVersion和targetSdkVersion改回默认又可以,请问是怎么回事?

1个回答

热门排序