Android 使用 Azure 通知中心推送通知

Android Push Notification with Azure Notification Hub

我正在尝试使用 Azure 通知中心将推送通知实施到我的 Android 应用程序中。我已按照说明 here 进行操作,但是当我进入 Adding Azure Notification Hubs libraries 的步骤时,我卡住了。首先,他们提供的 link 的“文件”选项卡上没有名为 notification-hubs-0.4.jar 的文件,所以我假设我想要的是 notification-hubs-android-sdk-0.4.jar。所以我下载了它并将其包含在我的 assets\libs 文件夹中。然后我按照说明将所需的行添加到我的 build.gradle 文件中,但我一直收到错误消息

任务“:app:processDebugResources”执行失败进程“命令'C:\pathtothefile...\aapt.exe'”以非零退出值 1 完成。

我的 build.gradle 文件看起来像这样...

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.2'
    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.myapplicationid.android"
        minSdkVersion 10
        targetSdkVersion 23
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-project.txt'
        }
    }
}

dependencies {
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.microsoft.azure:azure-notifications-handler:1.0.1@aar'
    compile files('src/main/assets/libs/android-maps-extensions.jar')
    compile files('src/main/assets/libs/android-viewbadger.jar')
}

repositories {
    maven {
        url "http://dl.bintray.com/microsoftazuremobile/SDK"
    }
}

我是不是做错了什么?有人可以指出我的错误吗?

我们也会适当地更新文档,但是当我们这样做时,将编译 'com.microsoft.azure:notification-hubs-android-sdk:0.4@aar' 添加到依赖项中,看看是否可行。