<small id='Eg2x8'></small><noframes id='Eg2x8'>

      • <bdo id='Eg2x8'></bdo><ul id='Eg2x8'></ul>
      <i id='Eg2x8'><tr id='Eg2x8'><dt id='Eg2x8'><q id='Eg2x8'><span id='Eg2x8'><b id='Eg2x8'><form id='Eg2x8'><ins id='Eg2x8'></ins><ul id='Eg2x8'></ul><sub id='Eg2x8'></sub></form><legend id='Eg2x8'></legend><bdo id='Eg2x8'><pre id='Eg2x8'><center id='Eg2x8'></center></pre></bdo></b><th id='Eg2x8'></th></span></q></dt></tr></i><div id='Eg2x8'><tfoot id='Eg2x8'></tfoot><dl id='Eg2x8'><fieldset id='Eg2x8'></fieldset></dl></div>

      <legend id='Eg2x8'><style id='Eg2x8'><dir id='Eg2x8'><q id='Eg2x8'></q></dir></style></legend>

      <tfoot id='Eg2x8'></tfoot>
      1. NotificationCompat.Builder(getApplicationContext(), CHANNEL_

        时间:2023-07-29

      2. <small id='4n8JT'></small><noframes id='4n8JT'>

      3. <tfoot id='4n8JT'></tfoot>
        <i id='4n8JT'><tr id='4n8JT'><dt id='4n8JT'><q id='4n8JT'><span id='4n8JT'><b id='4n8JT'><form id='4n8JT'><ins id='4n8JT'></ins><ul id='4n8JT'></ul><sub id='4n8JT'></sub></form><legend id='4n8JT'></legend><bdo id='4n8JT'><pre id='4n8JT'><center id='4n8JT'></center></pre></bdo></b><th id='4n8JT'></th></span></q></dt></tr></i><div id='4n8JT'><tfoot id='4n8JT'></tfoot><dl id='4n8JT'><fieldset id='4n8JT'></fieldset></dl></div>

          <legend id='4n8JT'><style id='4n8JT'><dir id='4n8JT'><q id='4n8JT'></q></dir></style></legend>

            <bdo id='4n8JT'></bdo><ul id='4n8JT'></ul>

              <tbody id='4n8JT'></tbody>

                  本文介绍了NotificationCompat.Builder(getApplicationContext(), CHANNEL_ID) 不适用于 Oreo Firebase 通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试在 Oreo 版本 中使用 Firebase 显示通知,所以当我得到解决方案时它没有显示
                  NotificationCompat.Builder(this, CHANNEL_ID) 但它向我展示了这样

                  而我的 build.gradle 文件是

                   应用插件:'com.android.application'依赖{编译项目(':库')编译项目(':camerafragment')编译'com.google.android.gms:play-services:11.0.0'编译'com.squareup.picasso:picasso:2.5.2'编译'com.mcxiaoke.volley:library:1.0.17'编译'com.android.support:appcompat-v7:26.0.0-alpha1'编译'com.android.support.constraint:constraint-layout:1.0.2'编译'com.android.support:recyclerview-v7:26.0.0-alpha1'编译'com.android.support:cardview-v7:26.0.0-alpha1'编译'com.google.firebase:firebase-messaging:11.0.0'编译'com.google.android.gms:play-services-maps:11.0.0'编译'com.facebook.android:facebook-android-sdk:[4,5)'编译'com.android.support:design:26.0.0-alpha1'编译'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'编译'com.jakewharton:butterknife:7.0.1'编译'com.google.android.gms:play-services-auth:11.0.0'编译'net.gotev:uploadservice:2.1'编译'com.google.firebase:firebase-auth:11.0.0'编译'com.google.code.gson:gson:2.8.0'编译'com.android.support:support-v4:26.0.0-alpha1'}安卓 {compileSdkVersion 27构建工具版本27.0.0"dex 选项 {javaMaxHeapSize "4g"}默认配置 {应用程序IDcom.trashmap"minSdkVersion 17targetSdkVersion 27//启用多索引支持.multiDexEnabled 真版本代码 17版本名称1.16"testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"}构建类型 {发布 {缩小启用假//shrinkResources true//新添加以减小大小proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}源集{主要的 {manifest.srcFile 'AndroidManifest.xml'java.srcDirs = ['src']res.srcDirs = ['res']}}}应用插件:'com.google.gms.google-services'

                  解决方案

                  NotificationCompat.Builder(上下文上下文)

                  <块引用>

                  此构造函数在 API 级别 26.1.0 中已弃用.

                  使用 NotificationCompat.Builder(Context, String) 代替.所有发布的通知都必须指定一个 NotificationChannel Id.

                  而且你已经定义了 compile 'com.android.support:support-v4:26.0.0-alpha1' 所以你必须改变你的支持库的版本号.

                  I am trying to show notification using Firebase in Oreo version so it's not showing when I get Solution
                  NotificationCompat.Builder(this, CHANNEL_ID) but it's showing me like this

                  and my build.gradle file is

                      apply plugin: 'com.android.application'
                  
                      dependencies {
                      compile project(':library')
                      compile project(':camerafragment')
                      compile 'com.google.android.gms:play-services:11.0.0'
                      compile 'com.squareup.picasso:picasso:2.5.2'
                      compile 'com.mcxiaoke.volley:library:1.0.17'
                      compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
                      compile 'com.android.support.constraint:constraint-layout:1.0.2'
                      compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
                      compile 'com.android.support:cardview-v7:26.0.0-alpha1'
                      compile 'com.google.firebase:firebase-messaging:11.0.0'
                      compile 'com.google.android.gms:play-services-maps:11.0.0'
                      compile 'com.facebook.android:facebook-android-sdk:[4,5)'
                      compile 'com.android.support:design:26.0.0-alpha1'
                      compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
                      compile 'com.jakewharton:butterknife:7.0.1'
                      compile 'com.google.android.gms:play-services-auth:11.0.0'
                      compile 'net.gotev:uploadservice:2.1'
                      compile 'com.google.firebase:firebase-auth:11.0.0'
                      compile 'com.google.code.gson:gson:2.8.0'
                      compile 'com.android.support:support-v4:26.0.0-alpha1'
                      }
                  
                      android {
                  
                      compileSdkVersion 27
                      buildToolsVersion "27.0.0"
                      dexOptions {
                          javaMaxHeapSize "4g"
                      }
                      defaultConfig {
                          applicationId "com.trashmap"
                          minSdkVersion 17
                          targetSdkVersion 27
                  
                          // Enabling multidex support.
                          multiDexEnabled true
                          versionCode 17
                          versionName "1.16"
                          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
                      }
                      buildTypes {
                          release {
                              minifyEnabled false
                             // shrinkResources true//new add to reduce size
                              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                          }
                  
                      }
                  
                  
                  
                        sourceSets {
                          main {
                              manifest.srcFile 'AndroidManifest.xml'
                              java.srcDirs = ['src']
                              res.srcDirs = ['res']
                          }
                      }
                  }
                  
                  apply plugin: 'com.google.gms.google-services'
                  

                  解决方案

                  NotificationCompat.Builder (Context context)
                  

                  This constructor was deprecated in API level 26.1.0.

                  use NotificationCompat.Builder(Context, String) instead. All posted Notifications must specify a NotificationChannel Id.

                  And you have defined compile 'com.android.support:support-v4:26.0.0-alpha1' So you have to change your version number of support library.

                  这篇关于NotificationCompat.Builder(getApplicationContext(), CHANNEL_ID) 不适用于 Oreo Firebase 通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:推送通知未在 Android 前台显示 下一篇:如何知道用户是否订阅了 FCM 中的主题?

                  相关文章

                    <bdo id='UkRHA'></bdo><ul id='UkRHA'></ul>
                    <legend id='UkRHA'><style id='UkRHA'><dir id='UkRHA'><q id='UkRHA'></q></dir></style></legend>
                    1. <tfoot id='UkRHA'></tfoot>

                      <i id='UkRHA'><tr id='UkRHA'><dt id='UkRHA'><q id='UkRHA'><span id='UkRHA'><b id='UkRHA'><form id='UkRHA'><ins id='UkRHA'></ins><ul id='UkRHA'></ul><sub id='UkRHA'></sub></form><legend id='UkRHA'></legend><bdo id='UkRHA'><pre id='UkRHA'><center id='UkRHA'></center></pre></bdo></b><th id='UkRHA'></th></span></q></dt></tr></i><div id='UkRHA'><tfoot id='UkRHA'></tfoot><dl id='UkRHA'><fieldset id='UkRHA'></fieldset></dl></div>

                      <small id='UkRHA'></small><noframes id='UkRHA'>